motion-dom 13.4.5 → 13.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +413 -346
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/animation/FollowAnimation.mjs +1 -4
- package/dist/es/animation/FollowAnimation.mjs.map +1 -1
- package/dist/es/animation/NativeAnimation.mjs +2 -5
- package/dist/es/animation/NativeAnimation.mjs.map +1 -1
- package/dist/es/animation/drivers/frame.mjs +2 -1
- package/dist/es/animation/drivers/frame.mjs.map +1 -1
- package/dist/es/animation/generators/spring.mjs +64 -35
- package/dist/es/animation/generators/spring.mjs.map +1 -1
- package/dist/es/animation/utils/notify-inspector.mjs +1 -1
- package/dist/es/animation/utils/notify-inspector.mjs.map +1 -1
- package/dist/es/frameloop/batcher.mjs +5 -6
- package/dist/es/frameloop/batcher.mjs.map +1 -1
- package/dist/es/frameloop/frame-data.mjs +12 -0
- package/dist/es/frameloop/frame-data.mjs.map +1 -0
- package/dist/es/frameloop/frame.mjs +3 -2
- package/dist/es/frameloop/frame.mjs.map +1 -1
- package/dist/es/frameloop/sync-time.mjs +1 -1
- package/dist/es/frameloop/sync-time.mjs.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/layout/LayoutAnimationBuilder.mjs +2 -1
- package/dist/es/layout/LayoutAnimationBuilder.mjs.map +1 -1
- package/dist/es/projection/animation/mix-values.mjs +1 -1
- package/dist/es/projection/animation/mix-values.mjs.map +1 -1
- package/dist/es/projection/node/create-projection-node.mjs +11 -1
- package/dist/es/projection/node/create-projection-node.mjs.map +1 -1
- package/dist/es/projection/styles/default-scale-correctors.mjs +18 -0
- package/dist/es/projection/styles/default-scale-correctors.mjs.map +1 -0
- package/dist/es/projection/styles/scale-correction.mjs +1 -14
- package/dist/es/projection/styles/scale-correction.mjs.map +1 -1
- package/dist/es/projection/utils/each-axis.mjs.map +1 -1
- package/dist/es/render/VisualElement.mjs +12 -2
- package/dist/es/render/VisualElement.mjs.map +1 -1
- package/dist/es/render/svg/SVGVisualElement.mjs +19 -1
- package/dist/es/render/svg/SVGVisualElement.mjs.map +1 -1
- package/dist/es/value/follow-value.mjs +8 -85
- package/dist/es/value/follow-value.mjs.map +1 -1
- package/dist/es/value/spring-value.mjs +8 -3
- package/dist/es/value/spring-value.mjs.map +1 -1
- package/dist/es/value/utils/as-number.mjs +4 -0
- package/dist/es/value/utils/as-number.mjs.map +1 -0
- package/dist/es/value/utils/follow.mjs +94 -0
- package/dist/es/value/utils/follow.mjs.map +1 -0
- package/dist/index.d.ts +30 -14
- package/dist/motion-dom.dev.js +413 -346
- package/dist/motion-dom.js +1 -1
- package/dist/size-rollup-motion-value.js +1 -1
- package/dist/size-rollup-motion-value.js.map +1 -1
- package/dist/size-rollup-style-effect.js +1 -1
- package/dist/size-rollup-style-effect.js.map +1 -1
- package/package.json +6 -5
- package/dist/es/scroll/observe.mjs +0 -19
- package/dist/es/scroll/observe.mjs.map +0 -1
package/dist/motion-dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(t,i){let s=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,l=n.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(a),t),{}),{setup:c,read:u,resolveKeyframes:h,preUpdate:d,update:p,preRender:m,render:f,postRender:y}=l,g=()=>{const n=e.MotionGlobalConfig.useManualTiming,a=n?r.timestamp:performance.now();s=!1,n||(r.delta=o?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,c.process(r),u.process(r),h.process(r),d.process(r),p.process(r),m.process(r),f.process(r),y.process(r),r.isProcessing=!1,s&&i&&(o=!1,t(g))};return{schedule:n.reduce((e,n)=>{const i=l[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,r.isProcessing||t(g)),i.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<n.length;e++)l[n[e]].cancel(t)},state:r,steps:l}}const{schedule:s,cancel:o,state:r,steps:a}=i("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let l;function c(){l=void 0}const u={now:()=>(void 0===l&&u.set(r.isProcessing||e.MotionGlobalConfig.useManualTiming?r.timestamp:performance.now()),l),set:t=>{l=t,queueMicrotask(c)}},h=t=>Math.round(1e5*t)/1e5,d=t=>e=>"string"==typeof e&&e.startsWith(t),p=d("--"),m=d("var(--"),f=t=>!!m(t)&&y.test(t.split("/*")[0].trim()),y=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function g(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const v={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},x={...v,transform:t=>e.clamp(0,1,t)},T={...v,default:1},w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const b=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S=(t,e)=>n=>Boolean("string"==typeof n&&b.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),A=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(w);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},P={...v,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},V={test:S("rgb","red"),parse:A("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+P.transform(t)+", "+P.transform(e)+", "+P.transform(n)+", "+h(x.transform(i))+")"};const M={test:S("#"),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:V.transform},E=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),k=E("deg"),D=E("%"),C=E("px"),R=E("vh"),B=E("vw"),j=(()=>({...D,parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}))(),L={test:S("hsl","hue"),parse:A("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+D.transform(h(e))+", "+D.transform(h(n))+", "+h(x.transform(i))+")"},O={test:t=>V.test(t)||M.test(t)||L.test(t),parse:t=>V.test(t)?V.parse(t):L.test(t)?L.parse(t):M.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?V.transform(t):L.transform(t),getAnimatableNone:t=>{const e=O.parse(t);return e.alpha=0,O.transform(e)}},F=new RegExp(w.source),I=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const N="number",U="color",$=/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 W(t){const e=t.toString();return F.test(e)||I.test(e)}function z(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace($,t=>(O.test(t)?(i.color.push(o),s.push(U),n.push(O.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(N),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function K({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===N?h(i[o]):t===U?O.transform(i[o]):i[o]}return s}}const G=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:O.test(n)?O.getAnimatableNone(n):n;var n};const Y={test:function(t){return isNaN(t)&&"string"==typeof t&&(F.test(t)||I.test(t))},parse:function(t){return z(t).values},createTransformer:function(t){return K(z(t))},getAnimatableNone:function(t){const e=z(t);return K(e)(e.values.map((t,n)=>G(t,e.split[n])))}};function X(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 q({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=X(a,i,t+1/3),o=X(a,i,t),r=X(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}}function H(t,e){return n=>n>0?e:t}const _=(t,e,n)=>t+(e-t)*n,Z=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},J=[M,V,L];function Q(t){const n=(i=t,J.find(t=>t.test(i)));var i;if(!n)return e.warning(!1,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let s=n.parse(t);return n===L&&(s=q(s)),s}const tt=(t,e)=>{const n=Q(t),i=Q(e);if(!n||!i)return H(t,e);const s={...n};return t=>(s.red=Z(n.red,i.red,t),s.green=Z(n.green,i.green,t),s.blue=Z(n.blue,i.blue,t),s.alpha=_(n.alpha,i.alpha,t),V.transform(s))},et=new Set(["none","hidden"]);function nt(t,e){return et.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function it(t,e){return n=>_(t,e,n)}function st(t){return"number"==typeof t?it:"string"==typeof t?f(t)?H:O.test(t)?tt:at:Array.isArray(t)?ot:"object"==typeof t?O.test(t)?tt:rt:H}function ot(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>st(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function rt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=st(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const at=(t,n)=>{const i=Y.createTransformer(n),s=z(t),o=z(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?et.has(t)&&!o.values.length||et.has(n)&&!s.values.length?nt(t,n):e.pipe(ot(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}(s,o),o.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' 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.`,"complex-values-different"),H(t,n))},lt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ct(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return _(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=lt.exec(t);if(!n)return;const i=lt.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>h(_(o,r,t))+s}(t,e);if(n)return n}return st(t)(t,e)}const ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>s.update(e,t),stop:()=>o(e),now:()=>r.isProcessing?r.timestamp:u.now()}},ht=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},dt=2e4;function pt(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(i?.push(o.value);!o.done&&s<n;)s+=e,o=t.next(s),i?.push(o.value);return s>=n?1/0:s}function mt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}const ft=100,yt=10,gt=1,vt=800,xt=.3,Tt=.3,wt={granular:.01,default:2},bt={granular:.005,default:.5},St=.01,At=10,Pt=.05,Vt=1;function Mt(t,e){return t*Math.sqrt(1-e*e)}const Et=.001;const kt=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Dt(t,e){if(kt(t,e))return t}function Ct(t){const n=Dt(t.stiffness),i=Dt(t.damping,!0),s=Dt(t.mass),o={...t,stiffness:n??ft,damping:i??yt,mass:s??gt,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??i??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const n=2*Math.PI/(1.2*t.visualDuration);o.stiffness=n*n,o.damping=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=vt,bounce:n=xt}){let i,s;e.warning(t<=e.secondsToMilliseconds(At),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-n;o=e.clamp(Pt,Vt,o),t=e.clamp(St,At,e.millisecondsToSeconds(t)),o<1?(i=e=>{const n=e*o,i=n*t,s=Mt(e,o),r=Math.exp(-i);return Et-n/s*r},s=e=>{const n=e*o*t,s=o*o*e*e*t,r=Math.exp(-n),a=Mt(e*e,o);return(-i(e)+Et>0?-1:1)*-s*r/a}):(i=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(i,s,5/t),a=r*r;return{stiffness:a,damping:2*o*Math.sqrt(a),duration:e.secondsToMilliseconds(t)}}(o)),o.isResolvedFromDuration=!0;kt(o.stiffness)&&kt(o.damping,!0)||(o.stiffness=ft,o.damping=yt)}return o}function Rt(t=Tt,n=xt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t,s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,isResolvedFromDuration:h,isTimeDefined:d}=Ct({...i}),p=t=>d?0:-e.millisecondsToSeconds(t),m=l/(2*Math.sqrt(a*c)),f=e.millisecondsToSeconds(Math.sqrt(a/c)),y=m*f,g={target:o,delta:o-s,velocity:p(i.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=i.restSpeed||(t?wt.granular:wt.default),g.restDelta=i.restDelta||(t?bt.granular:bt.default)};let x,T,w;if(v(),m<1){const t=Mt(f,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+y*g.delta)/t,e.sinC=y*e.A+g.delta*t,e.cosC=y*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};x=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){x=t=>g.target-Math.exp(-f*t)*(g.delta+(g.velocity+f*g.delta)*t);const t={C:0};w=()=>{t.C=g.velocity+f*g.delta},T=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(m*m-1);x=e=>{const n=Math.exp(-y*e),i=Math.min(t*e,300);return g.target-n*((g.velocity+y*g.delta)*Math.sinh(i)+t*g.delta*Math.cosh(i))/t};const e={P:0,sinh:0,cosh:0};w=()=>{e.P=(g.velocity+y*g.delta)/t,e.sinh=y*e.P-g.delta*t,e.cosh=y*g.delta-e.P*t},T=n=>{const i=Math.exp(-y*n),s=Math.min(t*n,300);return i*(e.sinh*Math.sinh(s)+e.cosh*Math.cosh(s))}}w();const b=h&&u||null,S={calculatedDuration:b,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=p(e),i.restSpeed&&i.restDelta||v(),S.calculatedDuration=b,r.done=!1,w()},velocity:t=>e.secondsToMilliseconds(T(t)),next:t=>{const n=x(t);if(h)r.done=t>=u;else{const i=e.secondsToMilliseconds(T(t));r.done=Math.abs(i)<=g.restSpeed&&Math.abs(g.target-n)<=g.restDelta}return r.value=r.done?g.target:n,r},toString:()=>{const t=Math.min(pt(S),dt),e=ht(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Bt({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=>{const e=g(t);d.done=Math.abs(e)<=c,d.value=d.done?y:y+e};let x,T;const w=t=>{var e;((e=d.value)<a||e>l)&&(x=t,T=Rt({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==x||(e=!0,v(t),w(t)),void 0!==x&&t>=x?T.next(t-x):(!e&&v(t),d)}}}function jt(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||ct,r=t.length-1;for(let i=0;i<r;i++){let r=o(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function Lt(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(_(i,1,o))}}function Ot(t){const e=[0];return Lt(e,t.length-1),e}function Ft(t,e){return t.map(t=>t*e)}function It(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Nt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s)||e.easeInOut,r={done:!1,value:n[0]};if(2===n.length&&!Array.isArray(o)&&(!i||2!==i.length||0===i[0]&&1===i[1])){const[i,s]=n,a=i===s?void 0:(e.MotionGlobalConfig.mix||ct)(i,s);return{calculatedDuration:t,next:n=>(r.value=a?a(o(t>0?e.clamp(0,1,n/t):1)):s,r.done=n>=t,r)}}const a=jt(Ft(i&&i.length===n.length?i:Ot(n),t),n,{ease:Array.isArray(o)?o:It(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Rt.applyToOptions=t=>{const n=mt(t,100,Rt);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function Ut(t,n,i=0){return n<=0?i:t.velocity?t.velocity(n):function(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}(e=>t.next(e).value,n,t.next(n).value)}const $t=t=>null!==t;function Wt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter($t),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const zt={decay:Bt,inertia:Bt,tween:Nt,keyframes:Nt,spring:Rt};function Kt(t){"string"==typeof t.type&&(t.type=zt[t.type])}function Gt(t,e){return{kind:t,animation:e,timestamp:u.now(),frameTimestamp:r.timestamp,frameIsProcessing:r.isProcessing}}function Yt(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Gt("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Xt{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const qt=t=>t/100;class Ht extends Xt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==u.now()&&this.tick(u.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Yt(this,this.options)}initAnimation(){const{options:t}=this;Kt(t);const{type:n=Nt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Nt;l!==Nt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(qt,ct(a[0],a[1])),a=[0,100]);const c=l(a===t.keyframes?t:{...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.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-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,T=this.currentTime,w=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(w=r)),T=e.clamp(0,1,i)*a}v?(this.delayState.value=u[0],x=this.delayState):x=w.next(T),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Bt&&(x.value=Wt(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Ut(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(u.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,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(u.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 _t=new Set(["brightness","contrast","saturate","opacity"]);function Zt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(w)||[];if(!i)return t;const s=n.replace(i,"");let o=_t.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Jt=/\b([a-z-]*)\(.*?\)/gu,Qt={...Y,getAnimatableNone:t=>{const e=t.match(Jt);return e?e.map(Zt).join(" "):t}},te={...Y,getAnimatableNone:t=>{const e=Y.parse(t);return Y.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ee={...v,transform:Math.round},ne={rotate:k,pathRotation:k,rotateX:k,rotateY:k,rotateZ:k,scale:T,scaleX:T,scaleY:T,scaleZ:T,skew:k,skewX:k,skewY:k,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:x,originX:j,originY:j,originZ:C},ie={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...ne,zIndex:ee,fillOpacity:x,strokeOpacity:x,numOctaves:ee},se={...ie,color:O,backgroundColor:O,outlineColor:O,fill:O,stroke:O,borderColor:O,borderTopColor:O,borderRightColor:O,borderBottomColor:O,borderLeftColor:O,filter:Qt,WebkitFilter:Qt,mask:te,WebkitMask:te},oe=t=>se[t],re=new Set([Qt,te]);function ae(t,e){let n=oe(t);return re.has(n)||(n=Y),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function le(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ce=t=>180*t/Math.PI,ue=t=>{const e=ce(Math.atan2(t[1],t[0]));return de(e)},he={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ue,rotateZ:ue,skewX:t=>ce(Math.atan(t[1])),skewY:t=>ce(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},de=t=>((t%=360)<0&&(t+=360),t),pe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),me=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),fe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pe,scaleY:me,scale:t=>(pe(t)+me(t))/2,rotateX:t=>de(ce(Math.atan2(t[6],t[5]))),rotateY:t=>de(ce(Math.atan2(-t[2],t[0]))),rotateZ:ue,rotate:ue,skewX:t=>ce(Math.atan(t[4])),skewY:t=>ce(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ye(t){return t.includes("scale")?1:0}function ge(t,e){if(!t||"none"===t)return ye(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=fe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=he,s=e}if(!s)return ye(e);const o=i[e],r=s[1].split(",").map(xe);return"function"==typeof o?o(r):r[o]}const ve=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ge(n,e)};function xe(t){return parseFloat(t.trim())}const Te=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],we=(()=>new Set([...Te,"pathRotation"]))(),be=t=>t===v||t===C,Se=new Set(["x","y","z"]),Ae=Te.filter(t=>!Se.has(t));const Pe=new Set(["bottom","right"]);function Ve(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const Me={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>Ve(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>Ve(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>ge(t,"x"),y:({transform:t})=>ge(t,"y")};Me.translateX=Me.x,Me.translateY=Me.y;const Ee=new Set;let ke=!1,De=!1,Ce=!1;function Re(){if(De){const t=[],e=new Set,n=new Set;Ee.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),Pe.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Ae.forEach(n=>{const i=t.getValue(n);if(void 0!==i){const t=i.get(),s=n.startsWith("scale")?1:0;if(t===s)return;e.push([n,t]),i.set(s)}}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.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)})}De=!1,ke=!1,Ee.forEach(t=>t.complete(Ce)),Ee.clear()}function Be(){Ee.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(De=!0)})}function je(){Ce=!0,Be(),Re(),Ce=!1}class Le{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?(Ee.add(this),ke||(ke=!0,s.read(Be),s.resolveKeyframes(Re))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(null===t[0]){const o=s?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;else if(i&&n){const s=function(t,n,i){if("string"==typeof t){if(e.isNumericalString(t)||e.isZeroValueString(t))return parseFloat(t);if(!Y.test(t)&&Y.test(i))return ae(n,i)}return t??void 0}(i.readValue(n,r),n,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===o&&s.set(t[0])}le(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ee.delete(this)}cancel(){"scheduled"===this.state&&(Ee.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Oe=t=>t.startsWith("--");function Fe(t,e,n){Oe(e)?t.style.setProperty(e,n):t.style[e]=n}const Ie={};function Ne(t,n){const i=e.memo(t);return()=>Ie[n]??i()}const Ue=Ne(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),$e=Ne(()=>void 0!==window.ViewTimeline,"viewTimeline"),We=Ne(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ze=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Ke={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ze([0,.65,.55,1]),circOut:ze([.55,0,1,.45]),backIn:ze([.31,.01,.66,-.59]),backOut:ze([.33,1.53,.69,.99])};function Ge(t,n){return t?"function"==typeof t?We()?ht(t,n):"ease-out":e.isBezierDefinition(t)?ze(t):Array.isArray(t)?t.map(t=>Ge(t,n)||Ke.easeOut):Ke[t]:void 0}function Ye(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=Ge(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"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Xe(t){return"function"==typeof t&&"applyToOptions"in t}function qe({type:t,...e}){return Xe(t)&&We()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class He extends Xt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=qe(t);this.animation=Ye(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Wt(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Fe(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()},Yt(this,t,c)}play(){this.isStopped||(this.manualStartTime=null,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(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ue()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e.noop):s(this)}}const _e={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Ze(t){"string"==typeof t.ease&&t.ease in _e&&(t.ease=_e[t.ease])}class Je extends He{constructor(t){Ze(t),Kt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...r}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new Ht({...r,autoplay:!1}),l=Math.max(10,u.now()-this.startTime),c=e.clamp(0,10,l-10),h=a.sample(l).value,{name:d}=this.options;o&&d&&Fe(o,d,h),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,h,c),a.stop()}}const Qe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Y.test(t)&&"0"!==t||t.startsWith("url(")));function tn(t){t.duration=0,t.type="keyframes"}const en=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),nn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const sn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),on=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function rn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!en.has(n)&&!sn.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return on()&&(en.has(n)||sn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&nn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class an extends Xt{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=u.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const r=s?.KeyframeResolver||Le;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=u.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=Qe(o,n),l=Qe(r,n);return a&&l?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"===i||Xe(i))&&s:(a!==l&&e.warning(!1,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!1)})(t,o,r,a)||(d=!1,!e.MotionGlobalConfig.instantAnimations&&l||h?.(Wt(t,i,n)),t[0]=t[t.length-1],tn(i),i.repeat=0);const p=s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:m}=i;i.startTime??(i.startTime=p),i.finalKeyframe=n,i.keyframes=t,i.onComplete=()=>{m?.(),this.notifyFinished()};let f;if(d&&!c&&rn(i)){i.element=i.motionValue?.owner?.current;try{f=new Je(i)}catch{f=new Ht(i)}}else f=new Ht(i);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),je()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}class ln{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return cn(this.animations,"duration")}get iterationDuration(){return cn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function cn(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class un extends He{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},Yt(this,{})}}const hn=new WeakMap;function dn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const pn={current:void 0};class mn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=u.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=u.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 this.on("change",t)}on(t,n){var i;return"change"===t?this.onChangeSubscribe(n):((i=this.events)[t]||(i[t]=new e.SubscriptionManager)).add(n)}onChangeSubscribe(t){const{events:n}=this;return n.change||this.changeSubscriber?(n.change||(n.change=new e.SubscriptionManager,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:n.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){s.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}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.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return pn.current&&pn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=u.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fn(t,e){return new mn(t,e)}function yn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function gn(t,e){const n=t?.[e]??t?.default??t;return n!==t?yn(n,t):n}const vn={type:"spring",stiffness:500,damping:25,restSpeed:10},xn={type:"keyframes",duration:.8},Tn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wn=(t,{keyframes:e})=>e.length>2?xn:we.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:vn:Tn,bn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Sn(t){for(const e in t)if(!bn.has(e))return!0;return!1}const An=(t,n,i,o={},r,a)=>l=>{const c=gn(o,t)||{},u=c.delay||o.delay||0;let{elapsed:h=0}=o;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...c,delay:-h,onUpdate:t=>{n.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:n,element:a?void 0:r};Sn(c)||Object.assign(d,wn(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(tn(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,tn(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,p&&!a&&void 0!==n.get()){const t=Wt(d.keyframes,c);if(void 0!==t)return void s.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Ht(d):new an(d)};function Pn(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Vn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Mn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const En=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kn(t){const e=En.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Dn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=kn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return f(o)?Dn(o,n,i+1):o}function Cn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Rn(t,e,n,i){if("function"==typeof e){const[s,o]=Cn(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]=Cn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Bn(t,e,n){const i=t.getProps();return Rn(i,e,void 0!==n?n:i.custom,t)}const jn=new Set(["width","height","top","left","right","bottom",...Te]),Ln=t=>Array.isArray(t);function On(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,fn(n))}function Fn(t){return Ln(t)?t[t.length-1]||0:t}function In(t,e){const n=Bn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){On(t,e,Fn(o[e]))}}const Nn=t=>Boolean(t&&t.getVelocity);function Un(t){return Boolean(Nn(t)&&t.add)}function $n(t,n){const i=t.getValue("willChange");if(Un(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function Wn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const zn="framerAppearId",Kn="data-"+Wn(zn);function Gn(t){return t.props[Kn]}const Yn="undefined"!=typeof window;function Xn({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function qn(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:r,transitionEnd:a,...l}=e;const c=t.getDefaultTransition();r=r?yn(r,c):c;const u=r?.reduceMotion,h=r?.skipAnimations;i&&(r=i);const d=[],p=o&&t.animationState&&t.animationState.getState()[o],m=r?.path;m&&m.animateVisualElement(t,l,r,n,d);for(const e in l){const i=t.getValue(e,t.latestValues[e]??null),o=l[e];if(void 0===o||p&&Xn(p,e))continue;const a={delay:n,...gn(r||{},e)};h&&(a.skipAnimations=!0);const c=i.get();if(void 0!==c&&!i.isAnimating()&&!Array.isArray(o)&&o===c&&!a.velocity){s.update(()=>i.set(o));continue}let m=!1;if(Yn&&window.MotionHandoffAnimation){const n=Gn(t);if(n){const t=window.MotionHandoffAnimation(n,e,s);null!==t&&(a.startTime=t,m=!0)}}$n(t,e);const f=u??t.shouldReduceMotion;i.start(An(e,i,o,f&&jn.has(e)?{type:!1}:a,t,m));const y=i.animation;y&&d.push(y)}if(a){const e=()=>s.update(()=>{a&&In(t,a)});d.length?Promise.all(d).then(e):e()}return d}function Hn(t,e,n={}){const i=Bn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(qn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Hn(l,e,{...r,delay:n+("function"==typeof i?0:i)+dn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function _n(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Hn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Hn(t,e,n);else{const s="function"==typeof e?Bn(t,e,n.custom):e;i=Promise.all(qn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Zn=t=>e=>e.test(t),Jn=[v,C,D,k,B,R,{test:t=>"auto"===t,parse:t=>t}],Qn=t=>Jn.find(Zn(t));function ti(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const ei=new Set(["auto","none","0"]);class ni extends Le{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(),f(i))){const s=Dn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!jn.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=Qn(i),r=Qn(s);if(g(i)!==g(s)&&Me[n])this.needsMeasurement=!0;else if(o!==r)if(be(o)&&be(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Me[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||ti(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!ei.has(e)&&W(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=ae(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return Me[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ii=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],si=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...ii,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const oi=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),ri=[];function ai(t){e.removeItem(ri,t)}function li(t,e,n={},i){const o=[],{velocity:r}=n,a=n.reduceMotion??i?.shouldReduceMotion;for(const l in e){if("transition"===l||"transitionEnd"===l)continue;const c=e[l];if(void 0===c)continue;const u=t(l),h=u.get();void 0===h||u.isAnimating()||Array.isArray(c)||c!==h||r?(u.start(An(l,u,c,a&&jn.has(l)?{type:!1}:n,i)),u.animation&&o.push(u.animation)):s.update(()=>u.set(c))}const{transitionEnd:l}=e;if(l){const e=()=>s.update(()=>{for(const e in l)t(e).set(l[e])});o.length?Promise.all(o).then(e):e()}return o}function ci(t,n,i,s,o){return li(s=>{let r=t.get(n,s);if(!r){let a;if(!o){const o=i[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(o)??t.read(n,s,o),e.invariant(void 0!==a,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}r=fn(a,{owner:o}),t(n,{[s]:r})}return r},i,s,o)}function ui(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function hi(t){return e.isObject(t)&&"ownerSVGElement"in t}const di=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function mi(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=pi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class fi{constructor(t=s.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,i){if(this.values.get(t)?.onRemove(),i)for(const t of this.values.values())t.value===i&&(n=t.render);const s=()=>n&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i<n;i++)if(e[i]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function yi(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new fi(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const gi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vi={};const xi=new Set(["originX","originY","originZ"]),Ti=(t,e)=>di(t.get(e)?.get(),ie[e]),wi=(t,e,n,i)=>{let s,o;if(we.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>Te.indexOf(t)-Te.indexOf(e)))}e.get("transform")||(ui(t)||e.get("transformBox")||wi(t,e,"transformBox",new mn("fill-box")),e.set("transform",new mn("none"),()=>{t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].get();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(vi[s]||(vi[s]=(gi[s]||s)+"("))+di(o,ne[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+di(s,ne.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else xi.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new mn(""),()=>{const n=Ti(e,"originX")??"50%",i=Ti(e,"originY")??"50%",s=Ti(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Oe(n)?()=>{t.style.setProperty(n,i.get())}:()=>{t.style[n]=di(i.get(),ie[n])};return e.set(n,i,s,o)},bi=(t,e)=>{if(we.has(e))return ve(t,e);const n=getComputedStyle(t),i=Oe(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Si=yi(wi,{test:t=>ui(t)||hi(t),read:bi}),Ai=mi(Si),Pi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Vi=Te.length;function Mi(t,e,n){let i="",s=!0;for(let o=0;o<Vi;o++){const r=Te[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=di(a,ie[r]);if(!l){s=!1;i+=`${Pi[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${di(o,ie.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function Ei(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(we.has(t))r=!0;else if(p(t))s[t]=n;else{const e=di(n,ie[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Mi(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 ki={offset:"stroke-dashoffset",array:"stroke-dasharray"},Di={offset:"strokeDashoffset",array:"strokeDasharray"};function Ci(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?ki:Di;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Ri=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Bi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Ei(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;for(const t of Ri)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(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&&Ci(h,s,o,r,!1)}const ji=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=Wn(s));const r=ie[n]||ie[s],a=o?()=>{t[s]=di(i.get(),ie[n])}:()=>{const e=di(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Li=mi(yi(ji));const Oi=(t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return s.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new mn("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return ji(t,e,n,i,Ui(n));return(Oe(n)||n in t.style?wi:ji)(t,e,n,i)},Fi=(t,e)=>we.has(e)?ie[e]?.default||0:Oe(e)||Ri.includes(e)?bi(t,e):(e=Ui(e),t.getAttribute(Wn(e))??t.getAttribute(e)??void 0),Ii=yi(Oi,{test:hi,read:Fi}),Ni=mi(Ii);function Ui(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function $i({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Wi(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function zi(t){return void 0===t||1===t}function Ki({scale:t,scaleX:e,scaleY:n}){return!zi(t)||!zi(e)||!zi(n)}function Gi(t){return Ki(t)||Yi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Yi(t){return Xi(t.x)||Xi(t.y)}function Xi(t){return t&&"0%"!==t}function qi(t,e,n){return n+e*(t-n)}function Hi(t,e,n,i,s){return void 0!==s&&(t=qi(t,s,i)),qi(t,n,i)+e}function _i(t,e=0,n=1,i,s){t.min=Hi(t.min,e,n,i,s),t.max=Hi(t.max,e,n,i,s)}function Zi(t,{x:e,y:n}){_i(t.x,e.translate,e.scale,e.originPoint),_i(t.y,n.translate,n.scale,n.originPoint)}const Ji=.999999999999,Qi=1.0000000000001;function ts(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(es(t.x,-o.scroll.offset.x),es(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Zi(t,r)),i&&Gi(o.latestValues)&&ss(t,o.latestValues,o.layout?.layoutBox))}e.x<Qi&&e.x>Ji&&(e.x=1),e.y<Qi&&e.y>Ji&&(e.y=1)}function es(t,e){t.min+=e,t.max+=e}function ns(t,e,n,i,s=.5){_i(t,e,n,_(t.min,t.max,s),i)}function is(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ss(t,e,n){const i=n??t;ns(t.x,is(e.x,i.x),e.scaleX,e.scale,e.originX),ns(t.y,is(e.y,i.y),e.scaleY,e.scale,e.originY)}function os(t,e){return $i(Wi(t.getBoundingClientRect(),e))}const rs={},as=t=>hi(t)?Ii:Si;class ls{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=ni}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return os(this.current)}getProps(){return rs}}function cs(t,e){const n=as(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const us=yi((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>e.isObject(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:hs,cancel:ds}=i(queueMicrotask,!1),ps={x:!1,y:!1};function ms(){return ps.x||ps.y}function fs(t,e){const n=pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const ys=(t,e)=>!!e&&(t===e||ys(t,e.parentElement)),gs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,vs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xs(t){return vs.has(t.tagName)||!0===t.isContentEditable}const Ts=new Set(["INPUT","SELECT","TEXTAREA"]);const ws=new WeakSet;function bs(t){return e=>{"Enter"===e.key&&t(e)}}function Ss(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function As(t){return gs(t)&&!ms()}const Ps=new WeakSet;const Vs=new WeakMap;let Ms;const Es=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:hi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],ks=Es("inline","width","offsetWidth"),Ds=Es("block","height","offsetHeight");function Cs({target:t,borderBoxSize:e}){Vs.get(t)?.forEach(n=>{n(t,{get width(){return ks(t,e)},get height(){return Ds(t,e)}})})}function Rs(t){t.forEach(Cs)}function Bs(t,e){Ms||"undefined"!=typeof ResizeObserver&&(Ms=new ResizeObserver(Rs));const n=pi(t);return n.forEach(t=>{let n=Vs.get(t);n||(n=new Set,Vs.set(t,n)),n.add(e),Ms?.observe(t)}),()=>{n.forEach(t=>{const n=Vs.get(t);n?.delete(e),n?.size||Ms?.unobserve(t)})}}const js=new Set;let Ls;function Os(t){return js.add(t),Ls||(Ls=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};js.forEach(e=>e(t))},window.addEventListener("resize",Ls)),()=>{js.delete(t),js.size||"function"!=typeof Ls||(window.removeEventListener("resize",Ls),Ls=void 0)}}const Fs={value:null,addProjectionMetrics:null};function Is(t){return hi(t)&&"svg"===t.tagName}function Ns(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Us(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=jt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const $s=new Set,Ws=({timestamp:t})=>{$s.forEach(e=>e.tick(t))};class zs extends Xt{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,Kt(t),this.factory=t.type||Nt,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():($s.size||s.update(Ws,!0),$s.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e,r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Ut(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():u.now()}teardown(){this.state="idle",this.driver?this.driver.stop():($s.delete(this),$s.size||o(Ws))}}function Ks(t,e){const n=fn(Nn(t)?t.get():t);return Gs(n,t,e),n}function Gs(t,e,n={}){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=Xs(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=Xs(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new zs({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),Nn(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Ys(e,r),!1)):t.set(Ys(e,r))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function Ys(t,e){return e?t+e:t}function Xs(t){return"number"==typeof t?t:parseFloat(t)}function qs(t){const e=[];pn.current=e;const n=t();pn.current=void 0;const i=fn(n);return function(t,e,n){const i=()=>e.set(n()),r=()=>s.preRender(i,!1,!0),a=t.map(t=>t.on("change",r));e.on("destroy",()=>{a.forEach(t=>t()),o(i)})}(e,i,t),i}const Hs=[...Jn,O,Y];let _s=0;const Zs=()=>"motion-view-"+_s++;function Js(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Qs(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function to(t,e,n,i,s,o=[],r,a=[],l){const c=pi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??Zs();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),Js(t,s,o),Qs(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=Zs(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),Js(t,s,o),Qs(t,d,r,a,l),d})}function eo(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let no={},io=null;const so=(t,e)=>{no[t]=e},oo=()=>{io||(io=document.createElement("style"),io.id="motion-view");let t="";for(const e in no){const n=no[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}io.textContent=t,document.head.appendChild(io),no={}},ro=()=>{io&&io.parentElement&&io.parentElement.removeChild(io)};function ao(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function lo(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const co=["layout","enter","exit","new","old"],uo=t=>t.split(" ").every(t=>0===parseFloat(t)),ho={group:["layout"],new:["new","enter"],old:["old","exit"]},po={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function mo(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new ln([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,pi(n)),y=to(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=to(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=to(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},S=(t,e,n,i,s)=>{const o=fo(gn(c,n),gn(function(t,e){for(const n of ho[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},A=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=qe(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},P=new Map,V=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of ii)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),M=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},E=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||so(":root",{"view-transition-name":"none"}),so("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{so(`::view-transition-group(${t})`,{overflow:"clip"}),so(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{so(`::view-transition-group-children(${t})`,{overflow:"clip"})}),oo()},k=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(h,d,p),ro()},D=async()=>{await n(),w("new"),V("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),E()};let C;try{w("old"),V("old"),E(),C=document.startViewTransition(D)}catch(t){return k(),Promise.reject(t)}return C.finished.finally(k),new Promise((t,n)=>{C.ready.then(()=>{const n=lo(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of co){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=eo(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=fo(gn(c,f),gn(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?po[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new He({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=ao(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new un(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=A(a.layer);d={delay:t,duration:e,easing:Ge(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=qe(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":Ge(s.ease,s.duration)}}n.updateTiming(d),i.push(new un(t))}P.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=A(e);for(const r of ii){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";uo(a)&&uo(l)||i.push(new He({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new ln(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new ln([])),n))})}function fo(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let yo=[],go=null;function vo(){go=null;const[t]=yo;var n;t&&(n=t,e.removeItem(yo,n),go=n,mo(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(vo))}function xo(){for(let t=yo.length-1;t>=0;t--){const e=yo[t],{interrupt:n}=e.options;if("immediate"===n){const n=yo.slice(0,t+1).map(t=>t.update),i=yo.slice(t+1);e.update=()=>{n.forEach(t=>t())},yo=[e,...i];break}}go&&"immediate"!==yo[0]?.options.interrupt||vo()}class To{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,yo.push(i),hs.render(xo)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const wo=()=>({translate:0,scale:1,origin:0,originPoint:0}),bo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),So=()=>({min:0,max:0}),Ao=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Po=new WeakMap;function Vo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Mo(t){return"string"==typeof t||Array.isArray(t)}const Eo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ko=["initial",...Eo];function Do(t){if(Vo(t.animate))return!0;for(let e=0;e<ko.length;e++)if(Mo(t[ko[e]]))return!0;return!1}function Co(t){return Boolean(Do(t)||t.variants)}function Ro(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Nn(s))t.addValue(i,s);else if(Nn(o))t.addValue(i,fn(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,fn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Bo={current:null},jo={current:!1},Lo="undefined"!=typeof window;function Oo(){if(jo.current=!0,Lo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Bo.current=t.matches;t.addEventListener("change",e),e()}else Bo.current=!1}const Fo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Io={};class No{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Le,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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.renderScheduledAt=0,this.scheduleRender=()=>{const t=u.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,s.render(this.render,!1,!0))};const{latestValues:c,renderState:h}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Do(e),this.isVariantNode=Co(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in p){const e=p[t];void 0!==c[t]&&Nn(e)&&e.set(c[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Po.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(jo.current||Oo(),this.shouldReduceMotion=Bo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),o(this.notifyUpdate),o(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&en.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new He({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=we.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&s.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),r&&r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Io){const e=Io[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,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}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Fo.length;e++){const n=Fo[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Ro(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);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=fn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):"number"!=typeof i&&!Y.test(i)&&Y.test(n)&&(i=ae(t,n)),this.setBaseTarget(t,Nn(i)?i.get():i)),Nn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Rn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Nn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){hs.render(this.render)}}class Uo extends No{constructor(){super(...arguments),this.KeyframeResolver=ni}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Nn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function $o(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function Wo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const zo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!C.test(t))return t;t=parseFloat(t)}return`${Wo(t,e.target.x)}% ${Wo(t,e.target.y)}%`}},Ko={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Y.parse(t);if(s.length>5)return i;const o=Y.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},Go={borderRadius:{...zo,applyTo:[...ii]},borderTopLeftRadius:zo,borderTopRightRadius:zo,borderBottomLeftRadius:zo,borderBottomRightRadius:zo,boxShadow:Ko};function Yo(t,{layout:e,layoutId:n}){return we.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Go[t]||"opacity"===t)}function Xo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Nn(i[e])||s&&Nn(s[e])||Yo(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class qo extends Uo{constructor(){super(...arguments),this.type="html",this.renderInstance=$o}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(we.has(e))return this.projection?.isProjecting?ye(e):ve(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(p(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return os(t,e)}build(t,e,n){Ei(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Xo(t,e,n)}}const Ho=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"]),_o=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Zo(t,e,n,i){$o(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ho.has(n)?n:Wn(n),e.attrs[n])}function Jo(t,e,n){const i=Xo(t,e,n);for(const n in t)if(Nn(t[n])||Nn(e[n])){i[-1!==Te.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Qo=ko.length;function tr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&tr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Qo;n++){const i=ko[n],s=t.props[i];(Mo(s)||!1===s)&&(e[i]=s)}return e}function er(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const nr=[...Eo].reverse(),ir=Eo.length;function sr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!er(e,t)}function or(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rr(){return{animate:or(!0),whileInView:or(),whileHover:or(),whileTap:or(),whileDrag:or(),whileFocus:or(),exit:or()}}function ar(t,e){t.min=e.min,t.max=e.max}function lr(t,e){ar(t.x,e.x),ar(t.y,e.y)}function cr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ur(t){return t.max-t.min}function hr(t,e,n){return Math.abs(t-e)<=n}function dr(t,e,n,i=.5){t.origin=i,t.originPoint=_(e.min,e.max,t.origin),t.scale=ur(n)/ur(e),t.translate=_(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function pr(t,e,n,i){dr(t.x,e.x,n.x,i?i.originX:void 0),dr(t.y,e.y,n.y,i?i.originY:void 0)}function mr(t,e,n,i=0){const s=i?_(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+ur(e)}function fr(t,e,n,i){mr(t.x,e.x,n.x,i?.x),mr(t.y,e.y,n.y,i?.y)}function yr(t,e,n,i=0){const s=i?_(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+ur(e)}function gr(t,e,n,i){yr(t.x,e.x,n.x,i?.x),yr(t.y,e.y,n.y,i?.y)}function vr(t,e,n,i,s){return t=qi(t-=e,1/n,i),void 0!==s&&(t=qi(t,1/s,i)),t}function xr(t,e=0,n=1,i=.5,s,o=t,r=t){if(D.test(e)){e=parseFloat(e);e=_(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=_(o.min,o.max,i);t===o&&(a-=e),t.min=vr(t.min,e,n,a,s),t.max=vr(t.max,e,n,a,s)}function Tr(t,e,[n,i,s],o,r){xr(t,e[n],e[i],e[s],e.scale,o,r)}const wr=["x","scaleX","originX"],br=["y","scaleY","originY"];function Sr(t,e,n,i){Tr(t.x,e,wr,n?n.x:void 0,i?i.x:void 0),Tr(t.y,e,br,n?n.y:void 0,i?i.y:void 0)}function Ar(t){return 0===t.translate&&1===t.scale}function Pr(t){return Ar(t.x)&&Ar(t.y)}function Vr(t,e){return t.min===e.min&&t.max===e.max}function Mr(t,e){return Vr(t.x,e.x)&&Vr(t.y,e.y)}function Er(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function kr(t,e){return Er(t.x,e.x)&&Er(t.y,e.y)}function Dr(t){return ur(t.x)/ur(t.y)}function Cr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Rr(t){return[t("x"),t("y")]}function Br(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const jr=ii.length,Lr=t=>"string"==typeof t?parseFloat(t):t,Or=t=>"number"==typeof t||C.test(t);function Fr(t,e,n,i,s,o){s?(t.opacity=_(0,n.opacity??1,Nr(i)),t.opacityExit=_(e.opacity??1,0,Ur(i))):o&&(t.opacity=_(e.opacity??1,n.opacity??1,i));for(let s=0;s<jr;s++){const o=ii[s];let r=Ir(e,o),a=Ir(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Or(r)===Or(a)?(t[o]=Math.max(_(Lr(r),Lr(a),i),0),(D.test(a)||D.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=_(e.rotate||0,n.rotate||0,i))}function Ir(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Nr=$r(0,.5,e.circOut),Ur=$r(.5,.95,e.noop);function $r(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function Wr(t,e,n){const i=Nn(t)?t:fn(t);return i.start(An("",i,e,n)),i.animation}function zr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Kr=(t,e)=>t.depth-e.depth;class Gr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Kr),this.isDirty=!1,this.children.forEach(t)}}function Yr(t,e){const n=u.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(o(i),t(r-e))};return s.setup(i,!0),()=>o(i)}function Xr(t){return Nn(t)?t.get():t}class qr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Hr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_r={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Zr=["","X","Y","Z"];let Jr=0;function Qr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function ta(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Gn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",s,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&ta(i)}function ea({attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(t={},e=n?.()){this.id=Jr++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Fs.value&&(_r.nodes=_r.calculatedTargetDeltas=_r.calculatedProjections=0),this.nodes.forEach(sa),this.nodes.forEach(ma),this.nodes.forEach(fa),this.nodes.forEach(oa),Fs.addProjectionMetrics&&Fs.addProjectionMetrics(_r)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Gr)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=hi(e)&&!Is(e),this.instance=e;const{layoutId:n,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const o=()=>this.root.updateBlockedByResize=!1;s.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Yr(o,250),Hr.hasAnimatedSinceResize&&(Hr.hasAnimatedSinceResize=!1,this.nodes.forEach(pa)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||wa,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!kr(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...gn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||pa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),o(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ya),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ta(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(la),void this.nodes.forEach(aa)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(ca);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ua),this.nodes.forEach(ha),this.nodes.forEach(da),this.nodes.forEach(na),this.nodes.forEach(ia)):this.nodes.forEach(ca),this.clearAllSnapshots();const t=u.now();r.delta=e.clamp(0,1e3/60,t-r.timestamp),r.timestamp=t,r.isProcessing=!0,a.update.process(r),a.preRender.process(r),a.render.process(r),r.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ra),this.sharedNodes.forEach(ga)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,s.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){s.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ur(this.snapshot.measuredBox.x)||ur(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=l(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!c)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Pr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Gi(this.latestValues)||s)&&(c(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Aa((i=n).x),Aa(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Va))){const{scroll:t}=this.root;t&&(es(e.x,t.offset.x),es(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(lr(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&lr(e,t),es(e.x,s.offset.x),es(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};lr(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(es(i.x,-n.scroll.offset.x),es(i.y,-n.scroll.offset.y)),Gi(n.latestValues)&&ss(i,n.latestValues,n.layout?.layoutBox)}return Gi(this.latestValues)&&ss(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};lr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!Gi(n.latestValues))continue;let i;n.instance&&(Ki(n.latestValues)&&n.updateSnapshot(),i=Ao(),lr(i,n.measurePageBox())),Sr(e,n.latestValues,n.snapshot?.layoutBox,i)}return Gi(this.latestValues)&&Sr(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==r.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(!this.layout||!i&&!s)return;this.resolvedRelativeTargetAt=r.timestamp;const o=this.getClosestProjectingParent();this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fr(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):lr(this.target,this.layout.layoutBox),Zi(this.target,this.targetDelta)):lr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),Fs.value&&_r.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Ki(this.parent.latestValues)&&!Yi(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},gr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),lr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===r.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;lr(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,a=this.treeScale.y;ts(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(cr(this.prevProjectionDelta.x,this.projectionDelta.x),cr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),pr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&Cr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Cr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Fs.value&&_r.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Ta));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=_(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=_(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(va(r.x,t.x,n),va(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,xa(c.x,m.x,f.x,y),xa(c.y,m.y,f.y,y),d&&Mr(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),lr(d,this.relativeTarget)),l&&(this.animationValues=o,Fr(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(o(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=s.update(()=>{Hr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Wr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Gt("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&Pa(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ur(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=ur(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}lr(e,s),ss(e,i),pr(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new qr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Qr("z",t,i,this.animationValues);for(let e=0;e<Zr.length;e++)Qr(`rotate${Zr[e]}`,t,i,this.animationValues),Qr(`skew${Zr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Xr(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Xr(e?.pointerEvents)||""),void(this.hasProjected&&!Gi(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=Br(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Go){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Go[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?Xr(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(aa),this.root.sharedNodes.clear()}}}function na(t){t.updateLayout()}function ia(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Rr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=ur(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";ar(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else Pa(s,e.layoutBox,n)&&Rr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=ur(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};pr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?pr(a,t.applyTransform(i,!0),e.measuredBox):pr(a,n,e.layoutBox);const l=!Pr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};gr(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};gr(l,n,o.layoutBox,r),kr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function sa(t){Fs.value&&_r.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function oa(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ra(t){t.clearSnapshot()}function aa(t){t.clearMeasurements()}function la(t){t.isLayoutDirty=!0,t.updateLayout()}function ca(t){t.isLayoutDirty=!1}function ua(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function ha(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function da(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function pa(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ma(t){t.resolveTargetDelta()}function fa(t){t.calcProjection()}function ya(t){t.resetSkewAndRotation()}function ga(t){t.removeLeadSnapshot()}function va(t,e,n){t.translate=_(e.translate,0,n),t.scale=_(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xa(t,e,n,i){t.min=_(e.min,n.min,i),t.max=_(e.max,n.max,i)}function Ta(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const wa={duration:.45,ease:[.4,0,.1,1]},ba=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Sa=ba("applewebkit/")&&!ba("chrome/")?Math.round:e.noop;function Aa(t){t.min=Sa(t.min),t.max=Sa(t.max)}function Pa(t,e,n){return"position"===t||"preserve-aspect"===t&&!hr(Dr(e),Dr(n),.2)}function Va(t){return t!==t.root&&t.scroll?.wasRoot}const Ma=ea({attachResizeListener:(t,e)=>zr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ea=t=>!t.isLayoutDirty&&t.willUpdate(!1);const ka={current:void 0},Da=ea({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ka.current){const t=new Ma({});t.mount(window),t.setOptions({layoutScroll:!0}),ka.current=t}return ka.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ca="[data-layout],[data-layout-id]",Ra=new WeakMap;let Ba;function ja(t){const e=[];return t instanceof HTMLElement&&t.matches(Ca)&&e.push(t),t.querySelectorAll(Ca).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function La(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Oa(t,e){let n=Ra.get(t);if(n)n.setOptions(La(t,e));else{let i=Po.get(t);i||(i=new qo({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),cs(t,i)),t.style.transform&&!Gi(i.latestValues)&&(t.style.transform=""),n=new Da(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Ra.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...La(t,e),visualElement:i}),n.mount(t),Ra.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Fa(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Ra.delete(t)}function Ia(){const t=Ba;Ba=void 0,function(){if(r.isProcessing)return;const t=u.now();r.delta=e.clamp(0,1e3/60,t-r.timestamp),r.timestamp=t,r.isProcessing=!0,a.update.process(r),a.preRender.process(r),a.render.process(r),r.isProcessing=!1}();const n=new Map;for(const e of t)for(const t of e.collectTargets()){const i=n.get(t);i?i.push(e):n.set(t,[e])}const i=new Map;for(const t of(s=n.keys(),[...s].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=n.get(t),s=Oa(t,e[e.length-1].transitionFor(t));for(const n of e)n.adopt(t,s);i.set(t,s)}var s;i.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;i.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),hs.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(l):l()}const Na=s,Ua=n.reduce((t,e)=>(t[e]=t=>o(t),t),{});t.AsyncMotionValueAnimation=an,t.DOMKeyframesResolver=ni,t.DOMVisualElement=Uo,t.DocumentProjectionNode=Ma,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=Gr,t.GroupAnimation=ln,t.GroupAnimationWithThen=class extends ln{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Da,t.HTMLVisualElement=qo,t.JSAnimation=Ht,t.KeyframeResolver=Le,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),Ba||(Ba=[],queueMicrotask(Ia)),Ba.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return ja(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of ja(this.scope)){if(this.tracked.has(e))continue;const n=Oa(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Fa(n,e)}}),e.relegate())return;n.remove()}Fa(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new ln([...t]))}},t.MotionValue=mn,t.MotionValueState=fi,t.NativeAnimation=He,t.NativeAnimationExtended=Je,t.NativeAnimationWrapper=un,t.NodeStack=qr,t.ObjectVisualElement=class extends No{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.SVGVisualElement=class extends Uo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ao}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(we.has(e)){const t=oe(e);return t&&t.default||0}if(Ri.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Ho.has(e)?e:Wn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Jo(t,e,n)}build(t,e,n){Bi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Zo(t,e,0,i)}mount(t){this.isSVGTag=_o(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=To,t.VisualElement=No,t.acceleratedValues=en,t.addAttrValue=ji,t.addDomEvent=zr,t.addEffect=function(t){e.invariant("function"==typeof t.test&&"function"==typeof t.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),ai(t),ri.unshift(t)},t.addSVGValue=Oi,t.addScaleCorrector=function(t){for(const e in t)Go[e]=t[e],p(e)&&(Go[e].isCSSVariable=!0)},t.addStyleValue=wi,t.addValueToWillChange=$n,t.alpha=x,t.analyseComplexValue=z,t.animateEffectSubject=ci,t.animateElement=function(t,e,n,i){if(i)return li(t=>i.getValue(t,null),e,n,i);const s=as(t);return ci(s,t,e,n,new ls(s,t))},t.animateMotionValue=An,t.animateSingleValue=Wr,t.animateTarget=qn,t.animateValue=function(t){return new Ht(t)},t.animateValues=li,t.animateVariant=Hn,t.animateView=function(t,e={}){return new To(t,e)},t.animateVisualElement=_n,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=_i,t.applyBoxDelta=Zi,t.applyGeneratorOptions=qe,t.applyPointDelta=Hi,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&si.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=ts,t.arc=function(t={}){const n=function({strength:t=.5,peak:n=.5,direction:i,rotate:s=!1}={}){const o=!0===s?1:"number"==typeof s?s:0;let r;return(s,a)=>{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=Mn(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l)<Math.abs(c),e=s.x+l*n,i=s.y+c*n,o=t?Math.sign(h.x-e):Math.sign(h.y-i);void 0!==r&&0!==o&&o!==r?(u=-u,h=Mn(s.x,s.y,a.x,a.y,u,n)):0!==o&&(r=o)}const d=o?Vn(0,s.x,h.x,a.x,s.y,h.y,a.y):0,p=o?Vn(1,s.x,h.x,a.x,s.y,h.y,a.y):0,m=o?e.wrap(-180,180,p-d):0;return t=>{const n={x:Pn(t,s.x,h.x,a.x),y:Pn(t,s.y,h.y,a.y)};if(o){const i=Vn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...gn(i||{},"x")};delete y.path;const g=fn(0);g.start(An("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=Dr,t.attachFollow=Gs,t.attachSpring=function(t,e,n){return Gs(t,e,{type:"spring",...n})},t.attrEffect=Li,t.axisDeltaEquals=Cr,t.axisEquals=Vr,t.axisEqualsRounded=Er,t.boxEquals=Mr,t.boxEqualsRounded=kr,t.buildHTMLStyles=Ei,t.buildProjectionTransform=Br,t.buildSVGAttrs=Bi,t.buildSVGPath=Ci,t.buildTransform=Mi,t.calcAxisDelta=dr,t.calcBoxDelta=pr,t.calcChildStagger=dn,t.calcGeneratorDuration=pt,t.calcLength=ur,t.calcRelativeAxis=mr,t.calcRelativeAxisPosition=yr,t.calcRelativeBox=fr,t.calcRelativePosition=gr,t.camelCaseAttributes=Ho,t.camelToDash=Wn,t.cancelFrame=o,t.cancelMicrotask=ds,t.cancelSync=Ua,t.checkVariantsDidChange=sr,t.cleanDirtyNodes=oa,t.collectMotionValues=pn,t.color=O,t.compareByDepth=Kr,t.complex=Y,t.containsCSSVariable=g,t.convertBoundingBoxToBox=$i,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ft,t.copyAxisDeltaInto=cr,t.copyAxisInto=ar,t.copyBoxInto=lr,t.correctBorderRadius=zo,t.correctBoxShadow=Ko,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>_n(t,e,n)))}(t),n=rr(),i=!0,s=!1;const o=e=>(n,i)=>{const s=Bn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=tr(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<ir;e++){const p=nr[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],y=Mo(f),g=p===r?m.isActive:null;!1===g&&(d=e);let v=f===l[p]&&f!==a[p]&&y;if(v&&(i||s)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===g||!f&&!m.prevProp||Vo(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==g){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const x=sr(m.prevProp,f);let T=x||p===r&&m.isActive&&!v&&y||e>d&&y,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:A={}}=m,P={...A,...S},V=e=>{T=!0,u.has(e)&&(w=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in P){const e=S[t],n=A[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ln(e)&&Ln(n)?!er(e,n)||x:e!==n,i?null!=e?V(t):u.add(t):void 0!==e&&u.has(t)?V(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(T=!1);const M=v&&x;T&&(!M||w)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Bn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=dn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Bn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=rr(),s=!0}}},t.createAxis=So,t.createAxisDelta=wo,t.createBox=Ao,t.createDelta=bo,t.createEffect=yi,t.createGeneratorEasing=mt,t.createProjectionNode=ea,t.createRenderBatcher=i,t.cubicBezierAsString=ze,t.defaultEasing=It,t.defaultOffset=Ot,t.defaultTransformValue=ye,t.defaultValueTypes=se,t.degrees=k,t.delay=Yr,t.delayInSeconds=function(t,n){return Yr(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Jn,t.eachAxis=Rr,t.fillOffset=Lt,t.fillWildcards=le,t.findDimensionValueType=Qn,t.findEffect=function(t){return ri.find(e=>e.test(t))},t.findValueType=t=>Hs.find(Zn(t)),t.flushKeyframeResolvers=je,t.followValue=Ks,t.frame=s,t.frameData=r,t.frameSteps=a,t.generateLinearEasing=ht,t.getAnimatableNone=ae,t.getAnimationMap=function(t){let e=hn.get(t);return e||(e=new Map,hn.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Oe(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=wn,t.getDefaultValueType=oe,t.getFeatureDefinitions=function(){return Io},t.getFinalKeyframe=Wt,t.getMixer=st,t.getOptimisedAppearId=Gn,t.getOriginIndex=Ns,t.getValueAsType=di,t.getValueTransition=gn,t.getVariableValue=Dn,t.getVariantContext=tr,t.getViewAnimationLayerInfo=ao,t.getViewAnimations=lo,t.globalProjectionState=Hr,t.handOffElementState=cs,t.has2DTranslate=Yi,t.hasComplexValues=W,t.hasReducedMotionListener=jo,t.hasScale=Ki,t.hasTransform=Gi,t.hex=M,t.hover=function(t,e,n={}){const[i,s,o]=fs(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ms())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=L,t.hslaToRgba=q,t.inertia=Bt,t.initPrefersReducedMotion=Oo,t.interpolate=jt,t.invisibleValues=et,t.isAnimationControls=Vo,t.isCSSVariableName=p,t.isCSSVariableToken=f,t.isControllingVariants=Do,t.isDeltaZero=Pr,t.isDragActive=ms,t.isDragging=ps,t.isElementKeyboardAccessible=xs,t.isElementTextInput=function(t){return Ts.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=Yo,t.isGenerator=Xe,t.isHTMLElement=ui,t.isKeyframesTarget=Ln,t.isMotionValue=Nn,t.isNear=hr,t.isNodeOrChild=ys,t.isPrimaryPointer=gs,t.isSVGElement=hi,t.isSVGSVGElement=Is,t.isSVGTag=_o,t.isTransitionDefined=Sn,t.isVariantLabel=Mo,t.isVariantNode=Co,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&We()||!n||"string"==typeof n&&(n in Ke||We())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=Un,t.keyframes=Nt,t.makeAnimationInstant=tn,t.mapEasingToNativeEasing=Ge,t.mapValue=function(t,e,n,i){const s=Us(e,n,i);return qs(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=os(t,n),{scroll:s}=e;return s&&(es(i.x,s.offset.x),es(i.y,s.offset.y)),i},t.measureViewportBox=os,t.microtask=hs,t.mix=ct,t.mixArray=ot,t.mixColor=tt,t.mixComplex=at,t.mixImmediate=H,t.mixLinearColor=Z,t.mixNumber=_,t.mixObject=rt,t.mixValues=Fr,t.mixVisibility=nt,t.motionValue=fn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ea);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=v,t.numberValueTypes=ie,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return s.preUpdate(i,!0),()=>o(i)},t.optimizedAppearDataAttribute=Kn,t.optimizedAppearDataId=zn,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:pi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=kn,t.parseValueFromTransform=ge,t.percent=D,t.pixelsToPercent=Wo,t.positionalKeys=jn,t.prefersReducedMotion=Bo,t.press=function(t,e,n={}){const[i,s,o]=fs(t,n),r=t=>{const i=t.currentTarget;if(!As(t))return;if(Ps.has(t))return;ws.add(i),n.stopPropagation&&Ps.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),ws.has(i)&&ws.delete(i),As(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||ys(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ui(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=bs(()=>{if(ws.has(n))return;Ss(n,"down");const t=bs(()=>{Ss(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ss(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),xs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=j,t.propEffect=us,t.propagateDirtyNodes=sa,t.px=C,t.readSVGValue=Fi,t.readStyleValue=bi,t.readTransformValue=ve,t.recordStats=function(){if(Fs.value)throw Fs.value=null,Fs.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Fs;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=xr,t.removeAxisTransforms=Tr,t.removeBoxTransforms=Sr,t.removeEffect=ai,t.removePointDelta=vr,t.renderHTML=$o,t.renderSVG=Zo,t.resize=function(t,e){return"function"==typeof t?Os(t):Bs(t,e)},t.resolveElements=pi,t.resolveMotionValue=Xr,t.resolveTransition=yn,t.resolveVariant=Bn,t.resolveVariantFromProps=Rn,t.rgbUnit=P,t.rgba=V,t.rootProjectionNode=ka,t.scale=T,t.scaleCorrectors=Go,t.scalePoint=qi,t.scrapeHTMLMotionValuesFromProps=Xo,t.scrapeSVGMotionValuesFromProps=Jo,t.setDragLock=function(t){return"x"===t||"y"===t?ps[t]?null:(ps[t]=!0,()=>{ps[t]=!1}):ps.x||ps.y?null:(ps.x=ps.y=!0,()=>{ps.x=ps.y=!1})},t.setFeatureDefinitions=function(t){Io=t},t.setStyle=Fe,t.setTarget=In,t.spring=Rt,t.springValue=function(t,e){return Ks(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:Ns(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ye,t.statsBuffer=Fs,t.styleEffect=Ai,t.styleSubjectEffect=Si,t.supportedWaapiEasing=Ke,t.supportsBrowserAnimation=rn,t.supportsFlags=Ie,t.supportsLinearEasing=We,t.supportsPartialKeyframes=oi,t.supportsScrollTimeline=Ue,t.supportsViewTimeline=$e,t.svgEffect=Ni,t.svgSubjectEffect=Ii,t.sync=Na,t.testValueType=Zn,t.time=u,t.transform=Us,t.transformAxis=ns,t.transformBox=ss,t.transformBoxPoints=Wi,t.transformPropOrder=Te,t.transformProps=we,t.transformValue=qs,t.transformValueTypes=ne,t.translateAxis=es,t.updateMotionValuesFromProps=Ro,t.variantPriorityOrder=Eo,t.variantProps=ko,t.vh=R,t.visualElementStore=Po,t.vw=B});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n={delta:0,timestamp:0,isProcessing:!1};let i;function s(){i=void 0}const o={now:()=>(void 0===i&&o.set(n.isProcessing||e.MotionGlobalConfig.useManualTiming?n.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(s)}},r=t=>Math.round(1e5*t)/1e5,a=t=>e=>"string"==typeof e&&e.startsWith(t),l=a("--"),c=a("var(--"),u=t=>!!c(t)&&h.test(t.split("/*")[0].trim()),h=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function d(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const p={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...p,transform:t=>e.clamp(0,1,t)},f={...p,default:1},y=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const g=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,v=(t,e)=>n=>Boolean("string"==typeof n&&g.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),x=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(y);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},T={...p,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},w={test:v("rgb","red"),parse:x("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+T.transform(t)+", "+T.transform(e)+", "+T.transform(n)+", "+r(m.transform(i))+")"};const b={test:v("#"),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:w.transform},S=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),V=S("deg"),A=S("%"),P=S("px"),M=S("vh"),E=S("vw"),k=(()=>({...A,parse:t=>A.parse(t)/100,transform:t=>A.transform(100*t)}))(),D={test:v("hsl","hue"),parse:x("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+A.transform(r(e))+", "+A.transform(r(n))+", "+r(m.transform(i))+")"},C={test:t=>w.test(t)||b.test(t)||D.test(t),parse:t=>w.test(t)?w.parse(t):D.test(t)?D.parse(t):b.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?w.transform(t):D.transform(t),getAnimatableNone:t=>{const e=C.parse(t);return e.alpha=0,C.transform(e)}},R=new RegExp(y.source),B=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const j="number",L="color",F=/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 O(t){const e=t.toString();return R.test(e)||B.test(e)}function I(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(F,t=>(C.test(t)?(i.color.push(o),s.push(L),n.push(C.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(j),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function N({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===j?r(i[o]):t===L?C.transform(i[o]):i[o]}return s}}const U=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:C.test(n)?C.getAnimatableNone(n):n;var n};const $={test:function(t){return isNaN(t)&&"string"==typeof t&&(R.test(t)||B.test(t))},parse:function(t){return I(t).values},createTransformer:function(t){return N(I(t))},getAnimatableNone:function(t){const e=I(t);return N(e)(e.values.map((t,n)=>U(t,e.split[n])))}};function W(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 z({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=W(a,i,t+1/3),o=W(a,i,t),r=W(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}}function K(t,e){return n=>n>0?e:t}const G=(t,e,n)=>t+(e-t)*n,Y=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},X=[b,w,D];function q(t){const n=(i=t,X.find(t=>t.test(i)));var i;if(!n)return e.warning(!1,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let s=n.parse(t);return n===D&&(s=z(s)),s}const H=(t,e)=>{const n=q(t),i=q(e);if(!n||!i)return K(t,e);const s={...n};return t=>(s.red=Y(n.red,i.red,t),s.green=Y(n.green,i.green,t),s.blue=Y(n.blue,i.blue,t),s.alpha=G(n.alpha,i.alpha,t),w.transform(s))},_=new Set(["none","hidden"]);function Z(t,e){return _.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function J(t,e){return n=>G(t,e,n)}function Q(t){return"number"==typeof t?J:"string"==typeof t?u(t)?K:C.test(t)?H:nt:Array.isArray(t)?tt:"object"==typeof t?C.test(t)?H:et:K}function tt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Q(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function et(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Q(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const nt=(t,n)=>{const i=$.createTransformer(n),s=I(t),o=I(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?_.has(t)&&!o.values.length||_.has(n)&&!s.values.length?Z(t,n):e.pipe(tt(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}(s,o),o.values),i):(e.warning(!0,`Complex values '${t}' and '${n}' 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.`,"complex-values-different"),K(t,n))},it=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function st(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return G(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=it.exec(t);if(!n)return;const i=it.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),a=parseFloat(i[1]);return t=>r(G(o,a,t))+s}(t,e);if(n)return n}return Q(t)(t,e)}const ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rt(t,n,i={delta:0,timestamp:0,isProcessing:!1}){let s=!1,o=!0;const r=()=>s=!0,a=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=e.MotionGlobalConfig.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=o?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,s&&n&&(o=!1,t(y))};return{schedule:ot.reduce((e,n)=>{const r=a[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,i.isProcessing||t(y)),r.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<ot.length;e++)a[ot[e]].cancel(t)},state:i,steps:a}}const{schedule:at,cancel:lt,steps:ct}=rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0,n),ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>at.update(e,t),stop:()=>lt(e),now:()=>n.isProcessing?n.timestamp:o.now()}},ht=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},dt=2e4;function pt(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(i?.push(o.value);!o.done&&s<n;)s+=e,o=t.next(s),i?.push(o.value);return s>=n?1/0:s}function mt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}const ft=100,yt=10,gt=1,vt=800,xt=.3,Tt=.3,wt={granular:.01,default:2},bt={granular:.005,default:.5},St=.01,Vt=10,At=.05,Pt=t=>t<0?1/Math.max(1+t,At):Math.max(1-t,At);function Mt(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,o=2*n*Math.exp(-e)*(1+e);return Dt(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function Et(t,e){return t*Math.sqrt(1-e*e)}const kt=12;function Dt(t,e,n){let i=n;for(let n=1;n<kt;n++)i-=t(i)/e(i);return i}const Ct=.001;const Rt=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Bt(t,e){if(Rt(t,e))return t}function jt(t){const n=Bt(t.stiffness),i=Bt(t.damping,!0),s=Bt(t.mass),o={...t,stiffness:n??ft,damping:i??yt,mass:s??gt,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??i??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=Pt(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*Mt(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=vt,bounce:n=xt}){let i,s;e.warning(t<=e.secondsToMilliseconds(Vt),"Spring duration must be 10 seconds or less","spring-duration-limit");const o=Pt(n);t=e.clamp(St,Vt,e.millisecondsToSeconds(t)),o<1?(i=e=>{const n=e*o,i=n*t,s=Et(e,o),r=Math.exp(-i);return Ct-n/s*r},s=e=>{const n=e*o*t,s=o*o*e*e*t,r=Math.exp(-n),a=Et(e*e,o);return(-i(e)+Ct>0?-1:1)*-s*r/a}):(i=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=Dt(i,s,5/t),a=r*Mt(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:e.secondsToMilliseconds(t)}}(o)),o.isResolvedFromDuration=!0;Rt(o.stiffness)&&Rt(o.damping,!0)||(o.stiffness=ft,o.damping=yt)}return o}function Lt(t=Tt,n=xt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t,s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,isResolvedFromDuration:h,isTimeDefined:d}=jt({...i}),p=t=>d?0:-e.millisecondsToSeconds(t),m=l/(2*Math.sqrt(a*c)),f=e.millisecondsToSeconds(Math.sqrt(a/c)),y=m*f,g={target:o,delta:o-s,velocity:p(i.velocity||0)||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=i.restSpeed||(t?wt.granular:wt.default),g.restDelta=i.restDelta||(t?bt.granular:bt.default)};let x,T,w;if(v(),m<1){const t=Et(f,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+y*g.delta)/t,e.sinC=y*e.A+g.delta*t,e.cosC=y*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};x=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){x=t=>g.target-Math.exp(-f*t)*(g.delta+(g.velocity+f*g.delta)*t);const t={C:0};w=()=>{t.C=g.velocity+f*g.delta},T=e=>Math.exp(-f*e)*(f*t.C*e-g.velocity)}else{const t=f*Math.sqrt(m*m-1),e=y-t,n=y+t,i=d?1/0:300/t,s=(t,e)=>Math.exp(e>i?-t*i-y*(e-i):-t*e),o={S:0,F:0};w=()=>{const e=(g.velocity+y*g.delta)/t;o.S=(g.delta+e)/2,o.F=(g.delta-e)/2},x=t=>g.target-o.S*s(e,t)-o.F*s(n,t),T=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const b=h&&u||null,S={calculatedDuration:b,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=p(e),i.restSpeed&&i.restDelta||v(),S.calculatedDuration=b,r.done=!1,w()},velocity:t=>e.secondsToMilliseconds(T(t)),next:t=>{const n=x(t);if(h)r.done=t>=u;else{const i=e.secondsToMilliseconds(T(t));r.done=Math.abs(i)<=g.restSpeed&&Math.abs(g.target-n)<=g.restDelta}return r.value=r.done?g.target:n,r},toString:()=>{const t=Math.min(pt(S),dt),e=ht(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Ft({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=>{const e=g(t);d.done=Math.abs(e)<=c,d.value=d.done?y:y+e};let x,T;const w=t=>{var e;((e=d.value)<a||e>l)&&(x=t,T=Lt({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==x||(e=!0,v(t),w(t)),void 0!==x&&t>=x?T.next(t-x):(!e&&v(t),d)}}}function Ot(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||st,r=t.length-1;for(let i=0;i<r;i++){let r=o(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function It(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(G(i,1,o))}}function Nt(t){const e=[0];return It(e,t.length-1),e}function Ut(t,e){return t.map(t=>t*e)}function $t(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Wt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s)||e.easeInOut,r={done:!1,value:n[0]};if(2===n.length&&!Array.isArray(o)&&(!i||2!==i.length||0===i[0]&&1===i[1])){const[i,s]=n,a=i===s?void 0:(e.MotionGlobalConfig.mix||st)(i,s);return{calculatedDuration:t,next:n=>(r.value=a?a(o(t>0?e.clamp(0,1,n/t):1)):s,r.done=n>=t,r)}}const a=Ot(Ut(i&&i.length===n.length?i:Nt(n),t),n,{ease:Array.isArray(o)?o:$t(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Lt.applyToOptions=t=>{const n=mt(t,100,Lt);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};function zt(t,n,i=0){return n<=0?i:t.velocity?t.velocity(n):function(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}(e=>t.next(e).value,n,t.next(n).value)}const Kt=t=>null!==t;function Gt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Kt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Yt={decay:Ft,inertia:Ft,tween:Wt,keyframes:Wt,spring:Lt};function Xt(t){"string"==typeof t.type&&(t.type=Yt[t.type])}function qt(t,e){return{kind:t,animation:e,timestamp:o.now(),frameTimestamp:n.timestamp,frameIsProcessing:n.isProcessing}}function Ht(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...qt("animation-start",t),options:n?{...e,...n}:e})}catch{}}class _t{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const Zt=t=>t/100;class Jt extends _t{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==o.now()&&this.tick(o.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Ht(this,this.options)}initAnimation(){const{options:t}=this;Xt(t);const{type:n=Wt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Wt;l!==Wt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Zt,st(a[0],a[1])),a=[0,100]);const c=l(a===t.keyframes?t:{...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.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-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x,T=this.currentTime,w=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(w=r)),T=e.clamp(0,1,i)*a}v?(this.delayState.value=u[0],x=this.delayState):x=w.next(T),o&&!v&&(x.value=o(x.value));let{done:b}=x;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ft&&(x.value=Gt(u,this.options,y,this.speed)),f&&f(x.value),S&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return zt(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(o.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,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(o.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 Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(y)||[];if(!i)return t;const s=n.replace(i,"");let o=Qt.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,ne={...$,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ie={...$,getAnimatableNone:t=>{const e=$.parse(t);return $.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},se={...p,transform:Math.round},oe={rotate:V,pathRotation:V,rotateX:V,rotateY:V,rotateZ:V,scale:f,scaleX:f,scaleY:f,scaleZ:f,skew:V,skewX:V,skewY:V,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:m,originX:k,originY:k,originZ:P},re={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...oe,zIndex:se,fillOpacity:m,strokeOpacity:m,numOctaves:se},ae={...re,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:ne,WebkitFilter:ne,mask:ie,WebkitMask:ie},le=t=>ae[t],ce=new Set([ne,ie]);function ue(t,e){let n=le(t);return ce.has(n)||(n=$),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function he(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const de=t=>180*t/Math.PI,pe=t=>{const e=de(Math.atan2(t[1],t[0]));return fe(e)},me={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pe,rotateZ:pe,skewX:t=>de(Math.atan(t[1])),skewY:t=>de(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},fe=t=>((t%=360)<0&&(t+=360),t),ye=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ge=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ve={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ye,scaleY:ge,scale:t=>(ye(t)+ge(t))/2,rotateX:t=>fe(de(Math.atan2(t[6],t[5]))),rotateY:t=>fe(de(Math.atan2(-t[2],t[0]))),rotateZ:pe,rotate:pe,skewX:t=>de(Math.atan(t[4])),skewY:t=>de(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function xe(t){return t.includes("scale")?1:0}function Te(t,e){if(!t||"none"===t)return xe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=ve,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=me,s=e}if(!s)return xe(e);const o=i[e],r=s[1].split(",").map(be);return"function"==typeof o?o(r):r[o]}const we=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Te(n,e)};function be(t){return parseFloat(t.trim())}const Se=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ve=(()=>new Set([...Se,"pathRotation"]))(),Ae=t=>t===p||t===P,Pe=new Set(["x","y","z"]),Me=Se.filter(t=>!Pe.has(t));const Ee=new Set(["bottom","right"]);function ke(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const De={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>ke(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>ke(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>Te(t,"x"),y:({transform:t})=>Te(t,"y")};De.translateX=De.x,De.translateY=De.y;const Ce=new Set;let Re=!1,Be=!1,je=!1;function Le(){if(Be){const t=[],e=new Set,n=new Set;Ce.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),Ee.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Me.forEach(n=>{const i=t.getValue(n);if(void 0!==i){const t=i.get(),s=n.startsWith("scale")?1:0;if(t===s)return;e.push([n,t]),i.set(s)}}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.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)})}Be=!1,Re=!1,Ce.forEach(t=>t.complete(je)),Ce.clear()}function Fe(){Ce.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Be=!0)})}function Oe(){je=!0,Fe(),Le(),je=!1}class Ie{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?(Ce.add(this),Re||(Re=!0,at.read(Fe),at.resolveKeyframes(Le))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(null===t[0]){const o=s?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;else if(i&&n){const s=function(t,n,i){if("string"==typeof t){if(e.isNumericalString(t)||e.isZeroValueString(t))return parseFloat(t);if(!$.test(t)&&$.test(i))return ue(n,i)}return t??void 0}(i.readValue(n,r),n,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===o&&s.set(t[0])}he(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ce.delete(this)}cancel(){"scheduled"===this.state&&(Ce.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Ne=t=>t.startsWith("--");function Ue(t,e,n){Ne(e)?t.style.setProperty(e,n):t.style[e]=n}const $e={};function We(t,n){const i=e.memo(t);return()=>$e[n]??i()}const ze=We(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ke=We(()=>void 0!==window.ViewTimeline,"viewTimeline"),Ge=We(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Ye=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Xe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ye([0,.65,.55,1]),circOut:Ye([.55,0,1,.45]),backIn:Ye([.31,.01,.66,-.59]),backOut:Ye([.33,1.53,.69,.99])};function qe(t,n){return t?"function"==typeof t?Ge()?ht(t,n):"ease-out":e.isBezierDefinition(t)?Ye(t):Array.isArray(t)?t.map(t=>qe(t,n)||Xe.easeOut):Xe[t]:void 0}function He(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=qe(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"};return c&&(d.pseudoElement=c),t.animate(u,d)}function _e(t){return"function"==typeof t&&"applyToOptions"in t}function Ze({type:t,...e}){return _e(t)&&Ge()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Je extends _t{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Ze(t);this.animation=He(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Gt(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Ue(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()},Ht(this,t,c)}play(){this.isStopped||(this.manualStartTime=null,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(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ze()?(this.animation.timeline=t,n?.(this.animation),e.noop):i(this)}}const Qe={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function tn(t){"string"==typeof t.ease&&t.ease in Qe&&(t.ease=Qe[t.ease])}class en extends Je{constructor(t){tn(t),Xt(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const l=new Jt({...a,autoplay:!1}),c=Math.max(10,o.now()-this.startTime),u=e.clamp(0,10,c-10),h=l.sample(c).value,{name:d}=this.options;r&&d&&Ue(r,d,h),n.setWithVelocity(l.sample(Math.max(0,c-u)).value,h,u),l.stop()}}const nn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$.test(t)&&"0"!==t||t.startsWith("url(")));function sn(t){t.duration=0,t.type="keyframes"}const on=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),rn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const an=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ln=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!on.has(n)&&!an.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ln()&&(on.has(n)||an.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&rn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class un extends _t{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=o.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const a=s?.KeyframeResolver||Ie;this.keyframeResolver=new a(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=o.now();let d=!0;(function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=nn(o,n),l=nn(r,n);return a&&l?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"===i||_e(i))&&s:(a!==l&&e.warning(!1,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!1)})(t,r,a,l)||(d=!1,!e.MotionGlobalConfig.instantAnimations&&c||h?.(Gt(t,i,n)),t[0]=t[t.length-1],sn(i),i.repeat=0);const p=s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:m}=i;i.startTime??(i.startTime=p),i.finalKeyframe=n,i.keyframes=t,i.onComplete=()=>{m?.(),this.notifyFinished()};let f;if(d&&!u&&cn(i)){i.element=i.motionValue?.owner?.current;try{f=new en(i)}catch{f=new Jt(i)}}else f=new Jt(i);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Oe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}class hn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return dn(this.animations,"duration")}get iterationDuration(){return dn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function dn(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class pn extends Je{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},Ht(this,{})}}const mn=new WeakMap;function fn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const yn={current:void 0};class gn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=o.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=o.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 this.on("change",t)}on(t,n){var i;return"change"===t?this.onChangeSubscribe(n):((i=this.events)[t]||(i[t]=new e.SubscriptionManager)).add(n)}onChangeSubscribe(t){const{events:n}=this;return n.change||this.changeSubscriber?(n.change||(n.change=new e.SubscriptionManager,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:n.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){at.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}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.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return yn.current&&yn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=o.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vn(t,e){return new gn(t,e)}function xn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Tn(t,e){const n=t?.[e]??t?.default??t;return n!==t?xn(n,t):n}const wn={type:"spring",stiffness:500,damping:25,restSpeed:10},bn={type:"keyframes",duration:.8},Sn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vn=(t,{keyframes:e})=>e.length>2?bn:Ve.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:wn:Sn,An=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Pn(t){for(const e in t)if(!An.has(e))return!0;return!1}const Mn=(t,n,i,s={},o,r)=>a=>{const l=Tn(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u-=e.secondsToMilliseconds(c);const h={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...l,delay:-u,onUpdate:t=>{n.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:n,element:r?void 0:o};Pn(l)||Object.assign(h,Vn(t,h)),h.duration&&(h.duration=e.secondsToMilliseconds(h.duration)),h.repeatDelay&&(h.repeatDelay=e.secondsToMilliseconds(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(sn(h),0===h.delay&&(d=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||o?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,sn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==n.get()){const t=Gt(h.keyframes,l);if(void 0!==t)return void at.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Jt(h):new un(h)};function En(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function kn(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Dn(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Cn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rn(t){const e=Cn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Bn(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=Rn(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return u(o)?Bn(o,n,i+1):o}function jn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ln(t,e,n,i){if("function"==typeof e){const[s,o]=jn(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]=jn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Fn(t,e,n){const i=t.getProps();return Ln(i,e,void 0!==n?n:i.custom,t)}const On=new Set(["width","height","top","left","right","bottom",...Se]),In=t=>Array.isArray(t);function Nn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vn(n))}function Un(t){return In(t)?t[t.length-1]||0:t}function $n(t,e){const n=Fn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Nn(t,e,Un(o[e]))}}const Wn=t=>Boolean(t&&t.getVelocity);function zn(t){return Boolean(Wn(t)&&t.add)}function Kn(t,n){const i=t.getValue("willChange");if(zn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function Gn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Yn="framerAppearId",Xn="data-"+Gn(Yn);function qn(t){return t.props[Xn]}const Hn="undefined"!=typeof window;function _n({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Zn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?xn(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&_n(d,e))continue;const r={delay:n,...Tn(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){at.update(()=>i.set(s));continue}let p=!1;if(Hn&&window.MotionHandoffAnimation){const n=qn(t);if(n){const t=window.MotionHandoffAnimation(n,e,at);null!==t&&(r.startTime=t,p=!0)}}Kn(t,e);const m=c??t.shouldReduceMotion;i.start(Mn(e,i,s,m&&On.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>at.update(()=>{r&&$n(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Jn(t,e,n={}){const i=Fn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Zn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Jn(l,e,{...r,delay:n+("function"==typeof i?0:i)+fn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Qn(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Jn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Jn(t,e,n);else{const s="function"==typeof e?Fn(t,e,n.custom):e;i=Promise.all(Zn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const ti=t=>e=>e.test(t),ei=[p,P,A,V,E,M,{test:t=>"auto"===t,parse:t=>t}],ni=t=>ei.find(ti(t));function ii(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const si=new Set(["auto","none","0"]);class oi extends Ie{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(),u(i))){const s=Bn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!On.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=ni(i),r=ni(s);if(d(i)!==d(s)&&De[n])this.needsMeasurement=!0;else if(o!==r)if(Ae(o)&&Ae(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else De[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||ii(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!si.has(e)&&O(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=ue(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return De[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ri=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ai=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...ri,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const li=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),ci=[];function ui(t){e.removeItem(ci,t)}function hi(t,e,n={},i){const s=[],{velocity:o}=n,r=n.reduceMotion??i?.shouldReduceMotion;for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const l=e[a];if(void 0===l)continue;const c=t(a),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Mn(a,c,l,r&&On.has(a)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):at.update(()=>c.set(l))}const{transitionEnd:a}=e;if(a){const e=()=>at.update(()=>{for(const e in a)t(e).set(a[e])});s.length?Promise.all(s).then(e):e()}return s}function di(t,n,i,s,o){return hi(s=>{let r=t.get(n,s);if(!r){let a;if(!o){const o=i[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(o)??t.read(n,s,o),e.invariant(void 0!==a,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}r=vn(a,{owner:o}),t(n,{[s]:r})}return r},i,s,o)}function pi(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function mi(t){return e.isObject(t)&&"ownerSVGElement"in t}const fi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function yi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function gi(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=yi(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class vi{constructor(t=at.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,i){if(this.values.get(t)?.onRemove(),i)for(const t of this.values.values())t.value===i&&(n=t.render);const s=()=>n&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i<n;i++)if(e[i]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function xi(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new vi(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const Ti={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wi={};const bi=new Set(["originX","originY","originZ"]),Si=(t,e)=>fi(t.get(e)?.get(),re[e]),Vi=(t,e,n,i)=>{let s,o;if(Ve.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>Se.indexOf(t)-Se.indexOf(e)))}e.get("transform")||(pi(t)||e.get("transformBox")||Vi(t,e,"transformBox",new gn("fill-box")),e.set("transform",new gn("none"),()=>{t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].get();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(wi[s]||(wi[s]=(Ti[s]||s)+"("))+fi(o,oe[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+fi(s,oe.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else bi.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new gn(""),()=>{const n=Si(e,"originX")??"50%",i=Si(e,"originY")??"50%",s=Si(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Ne(n)?()=>{t.style.setProperty(n,i.get())}:()=>{t.style[n]=fi(i.get(),re[n])};return e.set(n,i,s,o)},Ai=(t,e)=>{if(Ve.has(e))return we(t,e);const n=getComputedStyle(t),i=Ne(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Pi=xi(Vi,{test:t=>pi(t)||mi(t),read:Ai}),Mi=gi(Pi),Ei={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ki=Se.length;function Di(t,e,n){let i="",s=!0;for(let o=0;o<ki;o++){const r=Se[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=fi(a,re[r]);if(!l){s=!1;i+=`${Ei[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${fi(o,re.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function Ci(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(Ve.has(t))r=!0;else if(l(t))s[t]=n;else{const e=fi(n,re[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Di(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 Ri={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bi={offset:"strokeDashoffset",array:"strokeDasharray"};function ji(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ri:Bi;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Li=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Fi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Ci(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;for(const t of Li)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(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&&ji(h,s,o,r,!1)}const Oi=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=Gn(s));const r=re[n]||re[s],a=o?()=>{t[s]=fi(i.get(),re[n])}:()=>{const e=fi(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Ii=gi(xi(Oi));const Ni=(t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return at.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new gn("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Oi(t,e,n,i,zi(n));return(Ne(n)||n in t.style?Vi:Oi)(t,e,n,i)},Ui=(t,e)=>Ve.has(e)?re[e]?.default||0:Ne(e)||Li.includes(e)?Ai(t,e):(e=zi(e),t.getAttribute(Gn(e))??t.getAttribute(e)??void 0),$i=xi(Ni,{test:mi,read:Ui}),Wi=gi($i);function zi(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function Ki({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Gi(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Yi(t){return void 0===t||1===t}function Xi({scale:t,scaleX:e,scaleY:n}){return!Yi(t)||!Yi(e)||!Yi(n)}function qi(t){return Xi(t)||Hi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Hi(t){return _i(t.x)||_i(t.y)}function _i(t){return t&&"0%"!==t}function Zi(t,e,n){return n+e*(t-n)}function Ji(t,e,n,i,s){return void 0!==s&&(t=Zi(t,s,i)),Zi(t,n,i)+e}function Qi(t,e=0,n=1,i,s){t.min=Ji(t.min,e,n,i,s),t.max=Ji(t.max,e,n,i,s)}function ts(t,{x:e,y:n}){Qi(t.x,e.translate,e.scale,e.originPoint),Qi(t.y,n.translate,n.scale,n.originPoint)}const es=.999999999999,ns=1.0000000000001;function is(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ss(t.x,-o.scroll.offset.x),ss(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ts(t,r)),i&&qi(o.latestValues)&&as(t,o.latestValues,o.layout?.layoutBox))}e.x<ns&&e.x>es&&(e.x=1),e.y<ns&&e.y>es&&(e.y=1)}function ss(t,e){t.min+=e,t.max+=e}function os(t,e,n,i,s=.5){Qi(t,e,n,G(t.min,t.max,s),i)}function rs(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function as(t,e,n){const i=n??t;os(t.x,rs(e.x,i.x),e.scaleX,e.scale,e.originX),os(t.y,rs(e.y,i.y),e.scaleY,e.scale,e.originY)}function ls(t,e){return Ki(Gi(t.getBoundingClientRect(),e))}const cs={},us=t=>mi(t)?$i:Pi;class hs{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=oi}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return ls(this.current)}getProps(){return cs}}function ds(t,e){const n=us(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const ps=xi((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>e.isObject(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:ms,cancel:fs}=rt(queueMicrotask,!1),ys={x:!1,y:!1};function gs(){return ys.x||ys.y}function vs(t,e){const n=yi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const xs=(t,e)=>!!e&&(t===e||xs(t,e.parentElement)),Ts=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ws=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bs(t){return ws.has(t.tagName)||!0===t.isContentEditable}const Ss=new Set(["INPUT","SELECT","TEXTAREA"]);const Vs=new WeakSet;function As(t){return e=>{"Enter"===e.key&&t(e)}}function Ps(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ms(t){return Ts(t)&&!gs()}const Es=new WeakSet;const ks=new WeakMap;let Ds;const Cs=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:mi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Rs=Cs("inline","width","offsetWidth"),Bs=Cs("block","height","offsetHeight");function js({target:t,borderBoxSize:e}){ks.get(t)?.forEach(n=>{n(t,{get width(){return Rs(t,e)},get height(){return Bs(t,e)}})})}function Ls(t){t.forEach(js)}function Fs(t,e){Ds||"undefined"!=typeof ResizeObserver&&(Ds=new ResizeObserver(Ls));const n=yi(t);return n.forEach(t=>{let n=ks.get(t);n||(n=new Set,ks.set(t,n)),n.add(e),Ds?.observe(t)}),()=>{n.forEach(t=>{const n=ks.get(t);n?.delete(e),n?.size||Ds?.unobserve(t)})}}const Os=new Set;let Is;function Ns(t){return Os.add(t),Is||(Is=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Os.forEach(e=>e(t))},window.addEventListener("resize",Is)),()=>{Os.delete(t),Os.size||"function"!=typeof Is||(window.removeEventListener("resize",Is),Is=void 0)}}const Us={value:null,addProjectionMetrics:null};function $s(t){return mi(t)&&"svg"===t.tagName}function Ws(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function zs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Ot(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const Ks=new Set,Gs=({timestamp:t})=>{Ks.forEach(e=>e.tick(t))};class Ys extends _t{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.factory=t.type,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(Ks.size||at.update(Gs,!0),Ks.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e,r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return zt(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():o.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Ks.delete(this),Ks.size||lt(Gs))}}const Xs=t=>"number"==typeof t?t:parseFloat(t);function qs(t,e,n){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=Xs(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=Xs(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new Ys({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),Wn(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(Hs(e,r),!1)):t.set(Hs(e,r))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function Hs(t,e){return e?t+e:t}function _s(t,e,n={}){const i={type:"spring",...n};return Xt(i),i.type=i.type||Wt,qs(t,e,i)}function Zs(t){const e=[];yn.current=e;const n=t();yn.current=void 0;const i=vn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>at.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),lt(i)})}(e,i,t),i}function Js(t,e,n){return qs(t,e,{...n,type:Lt})}const Qs=[...ei,C,$];let to=0;const eo=()=>"motion-view-"+to++;function no(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function io(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function so(t,e,n,i,s,o=[],r,a=[],l){const c=yi(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??eo();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),no(t,s,o),io(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=eo(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),no(t,s,o),io(t,d,r,a,l),d})}function oo(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let ro={},ao=null;const lo=(t,e)=>{ro[t]=e},co=()=>{ao||(ao=document.createElement("style"),ao.id="motion-view");let t="";for(const e in ro){const n=ro[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}ao.textContent=t,document.head.appendChild(ao),ro={}},uo=()=>{ao&&ao.parentElement&&ao.parentElement.removeChild(ao)};function ho(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function po(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const mo=["layout","enter","exit","new","old"],fo=t=>t.split(" ").every(t=>0===parseFloat(t)),yo={group:["layout"],new:["new","enter"],old:["old","exit"]},go={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function vo(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new hn([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,y=new Set,g=new Map,v=new Map,x=new Map,T=new Map,w=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let y;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)T.set(n,yi(n)),y=so(n,u,h,void 0,i,d,c,p,m),x.set(n,y);else{for(const t of T.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);y=so(r.get(n),u,h,x.get(n),i,d,c,p,m)}else y=so(n,u,h,void 0,i,d,c,p,m);else y=[n];const w=o.get(n);y.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==w&&g.set(n,w);const o=v.get(n)??{};o[t]=[i,y.length],v.set(n,o)})})},b=(t,e)=>{const n=v.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},S=(t,e,n,i,s)=>{const o=xo(Tn(c,n),Tn(function(t,e){for(const n of yo[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},V=t=>{const[n,i]=b(t,"group"),s=S(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Ze(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},A=new Map,P=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of ri)o[t]=n[t];const r=A.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},A.set(e,r)}}),M=t=>{const e=A.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},E=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||lo(":root",{"view-transition-name":"none"}),lo("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),y.forEach(t=>{lo(`::view-transition-group(${t})`,{overflow:"clip"}),lo(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{lo(`::view-transition-group-children(${t})`,{overflow:"clip"})}),co()},k=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(h,d,p),uo()},D=async()=>{await n(),w("new"),P("new"),(()=>{y.clear();for(const t of v.keys())"root"!==t&&(g.get(t)??M(t))&&y.add(t)})(),E()};let C;try{w("old"),P("old"),E(),C=document.startViewTransition(D)}catch(t){return k(),Promise.reject(t)}return C.finished.finally(k),new Promise((t,n)=>{C.ready.then(()=>{const n=po(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of mo){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=oo(r),[h,d]=b(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,y]of Object.entries(p)){if(null==y)continue;if("x"===f||"y"===f){e.warnOnce(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=xo(Tn(c,f),Tn(m,f));if(!Array.isArray(y)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?go[u]?.[f]:void 0;void 0!==i&&(y=[i,y])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new Je({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:y})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=ho(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new pn(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=V(a.layer);d={delay:t,duration:e,easing:qe(n,e)}}else{const t=h?"group":a.type,[n,i]=b(a.layer,t);let s=S(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Ze(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":qe(s.ease,s.duration)}}n.updateTiming(d),i.push(new pn(t))}A.forEach((t,e)=>{if(!y.has(e))return;const{delay:n,duration:s,ease:o}=V(e);for(const r of ri){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";fo(a)&&fo(l)||i.push(new Je({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new hn(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new hn([])),n))})}function xo(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let To=[],wo=null;function bo(){wo=null;const[t]=To;var n;t&&(n=t,e.removeItem(To,n),wo=n,vo(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(bo))}function So(){for(let t=To.length-1;t>=0;t--){const e=To[t],{interrupt:n}=e.options;if("immediate"===n){const n=To.slice(0,t+1).map(t=>t.update),i=To.slice(t+1);e.update=()=>{n.forEach(t=>t())},To=[e,...i];break}}wo&&"immediate"!==To[0]?.options.interrupt||bo()}class Vo{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,To.push(i),ms.render(So)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Ao=()=>({translate:0,scale:1,origin:0,originPoint:0}),Po=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Mo=()=>({min:0,max:0}),Eo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ko=new WeakMap;function Do(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Co(t){return"string"==typeof t||Array.isArray(t)}const Ro=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bo=["initial",...Ro];function jo(t){if(Do(t.animate))return!0;for(let e=0;e<Bo.length;e++)if(Co(t[Bo[e]]))return!0;return!1}function Lo(t){return Boolean(jo(t)||t.variants)}function Fo(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Wn(s))t.addValue(i,s);else if(Wn(o))t.addValue(i,vn(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,vn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Oo={current:null},Io={current:!1},No="undefined"!=typeof window;function Uo(){if(Io.current=!0,No)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oo.current=t.matches;t.addEventListener("change",e),e()}else Oo.current=!1}const $o=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wo={};class zo{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ie,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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.renderScheduledAt=0,this.scheduleRender=()=>{const t=o.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,at.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=jo(e),this.isVariantNode=Lo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==c[t]&&Wn(e)&&e.set(c[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ko.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Io.current||Uo(),this.shouldReduceMotion=Oo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&on.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Je({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=Ve.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&at.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Wo){const e=Wo[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,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}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<$o.length;e++){const n=$o[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Fo(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);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=vn(e??this.getDefaultValue?.(t),{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):"number"!=typeof i&&!$.test(i)&&$.test(n)&&(i=ue(t,n)),this.setBaseTarget(t,Wn(i)?i.get():i)),Wn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Ln(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Wn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ms.render(this.render)}}class Ko extends zo{constructor(){super(...arguments),this.KeyframeResolver=oi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Wn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Go(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}const Yo={};function Xo(t,{layout:e,layoutId:n}){return Ve.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Yo[t]||"opacity"===t)}function qo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Wn(i[e])||s&&Wn(s[e])||Xo(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Ho extends Ko{constructor(){super(...arguments),this.type="html",this.renderInstance=Go}mount(t){e.invariant(Boolean(t.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,e){if(Ve.has(e))return this.projection?.isProjecting?xe(e):we(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(l(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ls(t,e)}build(t,e,n){Ci(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return qo(t,e,n)}}const _o=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"]),Zo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Jo(t,e,n,i){Go(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(_o.has(n)?n:Gn(n),e.attrs[n])}function Qo(t,e,n){const i=qo(t,e,n);for(const n in t)if(Wn(t[n])||Wn(e[n])){i[-1!==Se.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const tr=Bo.length;function er(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&er(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<tr;n++){const i=Bo[n],s=t.props[i];(Co(s)||!1===s)&&(e[i]=s)}return e}function nr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const ir=[...Ro].reverse(),sr=Ro.length;function or(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!nr(e,t)}function rr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ar(){return{animate:rr(!0),whileInView:rr(),whileHover:rr(),whileTap:rr(),whileDrag:rr(),whileFocus:rr(),exit:rr()}}function lr(t,e){t.min=e.min,t.max=e.max}function cr(t,e){lr(t.x,e.x),lr(t.y,e.y)}function ur(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function hr(t){return t.max-t.min}function dr(t,e,n){return Math.abs(t-e)<=n}function pr(t,e,n,i=.5){t.origin=i,t.originPoint=G(e.min,e.max,t.origin),t.scale=hr(n)/hr(e),t.translate=G(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function mr(t,e,n,i){pr(t.x,e.x,n.x,i?i.originX:void 0),pr(t.y,e.y,n.y,i?i.originY:void 0)}function fr(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+hr(e)}function yr(t,e,n,i){fr(t.x,e.x,n.x,i?.x),fr(t.y,e.y,n.y,i?.y)}function gr(t,e,n,i=0){const s=i?G(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+hr(e)}function vr(t,e,n,i){gr(t.x,e.x,n.x,i?.x),gr(t.y,e.y,n.y,i?.y)}function xr(t,e,n,i,s){return t=Zi(t-=e,1/n,i),void 0!==s&&(t=Zi(t,1/s,i)),t}function Tr(t,e=0,n=1,i=.5,s,o=t,r=t){if(A.test(e)){e=parseFloat(e);e=G(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=G(o.min,o.max,i);t===o&&(a-=e),t.min=xr(t.min,e,n,a,s),t.max=xr(t.max,e,n,a,s)}function wr(t,e,[n,i,s],o,r){Tr(t,e[n],e[i],e[s],e.scale,o,r)}const br=["x","scaleX","originX"],Sr=["y","scaleY","originY"];function Vr(t,e,n,i){wr(t.x,e,br,n?n.x:void 0,i?i.x:void 0),wr(t.y,e,Sr,n?n.y:void 0,i?i.y:void 0)}function Ar(t){return 0===t.translate&&1===t.scale}function Pr(t){return Ar(t.x)&&Ar(t.y)}function Mr(t,e){return t.min===e.min&&t.max===e.max}function Er(t,e){return Mr(t.x,e.x)&&Mr(t.y,e.y)}function kr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Dr(t,e){return kr(t.x,e.x)&&kr(t.y,e.y)}function Cr(t){return hr(t.x)/hr(t.y)}function Rr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Br(t){return[t("x"),t("y")]}function jr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!P.test(t))return t;t=parseFloat(t)}return`${jr(t,e.target.x)}% ${jr(t,e.target.y)}%`}},Fr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$.parse(t);if(s.length>5)return i;const o=$.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=G(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};function Or(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Ir=ri.length,Nr=t=>"number"==typeof t||P.test(t);function Ur(t,e,n,i,s,o){s?(t.opacity=G(0,n.opacity??1,Wr(i)),t.opacityExit=G(e.opacity??1,0,zr(i))):o&&(t.opacity=G(e.opacity??1,n.opacity??1,i));for(let s=0;s<Ir;s++){const o=ri[s];let r=$r(e,o),a=$r(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Nr(r)===Nr(a)?(t[o]=Math.max(G(Xs(r),Xs(a),i),0),(A.test(a)||A.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=G(e.rotate||0,n.rotate||0,i))}function $r(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Wr=Kr(0,.5,e.circOut),zr=Kr(.5,.95,e.noop);function Kr(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function Gr(t,e,n){const i=Wn(t)?t:vn(t);return i.start(Mn("",i,e,n)),i.animation}function Yr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Xr=(t,e)=>t.depth-e.depth;class qr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Xr),this.isDirty=!1,this.children.forEach(t)}}function Hr(t,e){const n=o.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(lt(i),t(o-e))};return at.setup(i,!0),()=>lt(i)}function _r(t){return Wn(t)?t.get():t}class Zr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Jr={borderRadius:{...Lr,applyTo:[...ri]},borderTopLeftRadius:Lr,borderTopRightRadius:Lr,borderBottomLeftRadius:Lr,borderBottomRightRadius:Lr,boxShadow:Fr},Qr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Yo,{...Jr,...Yo});const ta={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ea=["","X","Y","Z"];let na=0;function ia(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function sa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=qn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&sa(i)}function oa({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(t={},e=i?.()){this.id=na++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Us.value&&(ta.nodes=ta.calculatedTargetDeltas=ta.calculatedProjections=0),this.nodes.forEach(la),this.nodes.forEach(va),this.nodes.forEach(xa),this.nodes.forEach(ca),Us.addProjectionMetrics&&Us.addProjectionMetrics(ta)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new qr)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=mi(e)&&!$s(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;at.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Hr(s,250),Qr.hasAnimatedSinceResize&&(Qr.hasAnimatedSinceResize=!1,this.nodes.forEach(ga)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Aa,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Dr(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Tn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ga(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ta),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(da),void this.nodes.forEach(ha)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(pa);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ma),this.nodes.forEach(fa),this.nodes.forEach(ya),this.nodes.forEach(ra),this.nodes.forEach(aa)):this.nodes.forEach(pa),this.clearAllSnapshots();const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ms.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ua),this.sharedNodes.forEach(wa)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||hr(this.snapshot.measuredBox.x)||hr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=r(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!a)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Pr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||qi(this.latestValues)||s)&&(a(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Ea((i=n).x),Ea(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Da))){const{scroll:t}=this.root;t&&(ss(e.x,t.offset.x),ss(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(cr(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&cr(e,t),ss(e.x,s.offset.x),ss(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};cr(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(ss(i.x,-n.scroll.offset.x),ss(i.y,-n.scroll.offset.y)),qi(n.latestValues)&&as(i,n.latestValues,n.layout?.layoutBox)}return qi(this.latestValues)&&as(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};cr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!qi(n.latestValues))continue;let i;n.instance&&(Xi(n.latestValues)&&n.updateSnapshot(),i=Eo(),cr(i,n.measurePageBox())),Vr(e,n.latestValues,n.snapshot?.layoutBox,i)}return qi(this.latestValues)&&Vr(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==n.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=n.timestamp;const r=this.getClosestProjectingParent();this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yr(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):cr(this.target,this.layout.layoutBox),ts(this.target,this.targetDelta)):cr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),Us.value&&ta.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Xi(this.parent.latestValues)&&!Hi(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},vr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),cr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===n.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;cr(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;is(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(ur(this.prevProjectionDelta.x,this.projectionDelta.x),ur(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),mr(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Rr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Rr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Us.value&&ta.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Va));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);var c,m,f,y;i?(r.x.translate=i.x,r.x.scale=G(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=G(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(ba(r.x,t.x,n),ba(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vr(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c=this.relativeTarget,m=this.relativeTargetOrigin,f=a,y=n,Sa(c.x,m.x,f.x,y),Sa(c.y,m.y,f.y,y),d&&Er(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),cr(d,this.relativeTarget)),l&&(this.animationValues=o,Ur(o,s,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Qr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Gr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...qt("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&ka(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=hr(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=hr(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}cr(e,s),as(e,i),mr(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Zr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&ia("z",t,i,this.animationValues);for(let e=0;e<ea.length;e++)ia(`rotate${ea[e]}`,t,i,this.animationValues),ia(`skew${ea[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=_r(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=_r(e?.pointerEvents)||""),void(this.hasProjected&&!qi(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=Or(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Yo){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Yo[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?_r(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(ha),this.root.sharedNodes.clear()}}}function ra(t){t.updateLayout()}function aa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;if("size"===s)Br(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=hr(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";lr(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else ka(s,e.layoutBox,n)&&Br(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=hr(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};mr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?mr(a,t.applyTransform(i,!0),e.measuredBox):mr(a,n,e.layoutBox);const l=!Pr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};vr(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};vr(l,n,o.layoutBox,r),Dr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function la(t){Us.value&&ta.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ca(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ua(t){t.clearSnapshot()}function ha(t){t.clearMeasurements()}function da(t){t.isLayoutDirty=!0,t.updateLayout()}function pa(t){t.isLayoutDirty=!1}function ma(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function fa(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function ya(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ga(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function va(t){t.resolveTargetDelta()}function xa(t){t.calcProjection()}function Ta(t){t.resetSkewAndRotation()}function wa(t){t.removeLeadSnapshot()}function ba(t,e,n){t.translate=G(e.translate,0,n),t.scale=G(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Sa(t,e,n,i){t.min=G(e.min,n.min,i),t.max=G(e.max,n.max,i)}function Va(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Aa={duration:.45,ease:[.4,0,.1,1]},Pa=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ma=Pa("applewebkit/")&&!Pa("chrome/")?Math.round:e.noop;function Ea(t){t.min=Ma(t.min),t.max=Ma(t.max)}function ka(t,e,n){return"position"===t||"preserve-aspect"===t&&!dr(Cr(e),Cr(n),.2)}function Da(t){return t!==t.root&&t.scroll?.wasRoot}const Ca=oa({attachResizeListener:(t,e)=>Yr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ra=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Ba={current:void 0},ja=oa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ba.current){const t=new Ca({});t.mount(window),t.setOptions({layoutScroll:!0}),Ba.current=t}return Ba.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),La="[data-layout],[data-layout-id]",Fa=new WeakMap;let Oa;function Ia(t){const e=[];return t instanceof HTMLElement&&t.matches(La)&&e.push(t),t.querySelectorAll(La).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Na(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Ua(t,e){let n=Fa.get(t);if(n)n.setOptions(Na(t,e));else{let i=ko.get(t);i||(i=new Ho({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),ds(t,i)),t.style.transform&&!qi(i.latestValues)&&(t.style.transform=""),n=new ja(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Fa.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Na(t,e),visualElement:i}),n.mount(t),Fa.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function $a(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Fa.delete(t)}function Wa(){const t=Oa;Oa=void 0,function(){if(n.isProcessing)return;const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ct.update.process(n),ct.preRender.process(n),ct.render.process(n),n.isProcessing=!1}();const i=new Map;for(const e of t)for(const t of e.collectTargets()){const n=i.get(t);n?n.push(e):i.set(t,[e])}const s=new Map;for(const t of(r=i.keys(),[...r].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=i.get(t),n=Ua(t,e[e.length-1].transitionFor(t));for(const i of e)i.adopt(t,n);s.set(t,n)}var r;s.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const a=[];for(const e of t){const t=e.runUpdate();t&&a.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;s.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),ms.render(()=>{for(const e of t)e.finalize()})};a.length?Promise.all(a).then(l):l()}const za=at,Ka=ot.reduce((t,e)=>(t[e]=t=>lt(t),t),{});t.AsyncMotionValueAnimation=un,t.DOMKeyframesResolver=oi,t.DOMVisualElement=Ko,t.DocumentProjectionNode=Ca,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=qr,t.GroupAnimation=hn,t.GroupAnimationWithThen=class extends hn{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=ja,t.HTMLVisualElement=Ho,t.JSAnimation=Jt,t.KeyframeResolver=Ie,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),Oa||(Oa=[],queueMicrotask(Wa)),Oa.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return Ia(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of Ia(this.scope)){if(this.tracked.has(e))continue;const n=Ua(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),$a(n,e)}}),e.relegate())return;n.remove()}$a(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new hn([...t]))}},t.MotionValue=gn,t.MotionValueState=vi,t.NativeAnimation=Je,t.NativeAnimationExtended=en,t.NativeAnimationWrapper=pn,t.NodeStack=Zr,t.ObjectVisualElement=class extends zo{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.SVGVisualElement=class extends Ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Eo}getBaseTargetFromProps(t,e){return Ve.has(e)?super.getBaseTargetFromProps(t,e)??xe(e):t[e]}getDefaultValue(t){return Ve.has(t)?this.latestValues[t]??xe(t):void 0}readValueFromInstance(t,e){if(Ve.has(e)){const t=le(e);return t&&t.default||0}if(Li.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=_o.has(e)?e:Gn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Qo(t,e,n)}build(t,e,n){Fi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Jo(t,e,0,i)}mount(t){this.isSVGTag=Zo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=Vo,t.VisualElement=zo,t.acceleratedValues=on,t.addAttrValue=Oi,t.addDomEvent=Yr,t.addEffect=function(t){e.invariant("function"==typeof t.test&&"function"==typeof t.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),ui(t),ci.unshift(t)},t.addSVGValue=Ni,t.addScaleCorrector=function(t){for(const e in t)Yo[e]=t[e],l(e)&&(Yo[e].isCSSVariable=!0)},t.addStyleValue=Vi,t.addValueToWillChange=Kn,t.alpha=m,t.analyseComplexValue=I,t.animateEffectSubject=di,t.animateElement=function(t,e,n,i){if(i)return hi(t=>i.getValue(t,null),e,n,i);const s=us(t);return di(s,t,e,n,new hs(s,t))},t.animateMotionValue=Mn,t.animateSingleValue=Gr,t.animateTarget=Zn,t.animateValue=function(t){return new Jt(t)},t.animateValues=hi,t.animateVariant=Jn,t.animateView=function(t,e={}){return new Vo(t,e)},t.animateVisualElement=Qn,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=Qi,t.applyBoxDelta=ts,t.applyGeneratorOptions=Ze,t.applyPointDelta=Ji,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ai.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=is,t.arc=function(t={}){const n=function({strength:t=.5,peak:n=.5,direction:i,rotate:s=!1}={}){const o=!0===s?1:"number"==typeof s?s:0;let r;return(s,a)=>{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=Dn(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l)<Math.abs(c),e=s.x+l*n,i=s.y+c*n,o=t?Math.sign(h.x-e):Math.sign(h.y-i);void 0!==r&&0!==o&&o!==r?(u=-u,h=Dn(s.x,s.y,a.x,a.y,u,n)):0!==o&&(r=o)}const d=o?kn(0,s.x,h.x,a.x,s.y,h.y,a.y):0,p=o?kn(1,s.x,h.x,a.x,s.y,h.y,a.y):0,m=o?e.wrap(-180,180,p-d):0;return t=>{const n={x:En(t,s.x,h.x,a.x),y:En(t,s.y,h.y,a.y)};if(o){const i=kn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateVisualElement(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=e.x,c=e.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,y={delay:s,...Tn(i||{},"x")};delete y.path;const g=vn(0);g.start(Mn("",g,[0,1e3],{...y,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),g.animation&&o.push(g.animation),delete e.x,delete e.y}};return i},t.aspectRatio=Cr,t.attachFollow=_s,t.attachSpring=Js,t.attrEffect=Ii,t.axisDeltaEquals=Rr,t.axisEquals=Mr,t.axisEqualsRounded=kr,t.boxEquals=Er,t.boxEqualsRounded=Dr,t.buildHTMLStyles=Ci,t.buildProjectionTransform=Or,t.buildSVGAttrs=Fi,t.buildSVGPath=ji,t.buildTransform=Di,t.calcAxisDelta=pr,t.calcBoxDelta=mr,t.calcChildStagger=fn,t.calcGeneratorDuration=pt,t.calcLength=hr,t.calcRelativeAxis=fr,t.calcRelativeAxisPosition=gr,t.calcRelativeBox=yr,t.calcRelativePosition=vr,t.camelCaseAttributes=_o,t.camelToDash=Gn,t.cancelFrame=lt,t.cancelMicrotask=fs,t.cancelSync=Ka,t.checkVariantsDidChange=or,t.cleanDirtyNodes=ca,t.collectMotionValues=yn,t.color=C,t.compareByDepth=Xr,t.complex=$,t.containsCSSVariable=d,t.convertBoundingBoxToBox=Ki,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ut,t.copyAxisDeltaInto=ur,t.copyAxisInto=lr,t.copyBoxInto=cr,t.correctBorderRadius=Lr,t.correctBoxShadow=Fr,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Qn(t,e,n)))}(t),n=ar(),i=!0,s=!1;const o=e=>(n,i)=>{const s=Fn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=er(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<sr;e++){const p=ir[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],y=Co(f),g=p===r?m.isActive:null;!1===g&&(d=e);let v=f===l[p]&&f!==a[p]&&y;if(v&&(i||s)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===g||!f&&!m.prevProp||Do(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==g){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const x=or(m.prevProp,f);let T=x||p===r&&m.isActive&&!v&&y||e>d&&y,w=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(o(p),{});!1===g&&(S={});const{prevResolvedValues:V={}}=m,A={...V,...S},P=e=>{T=!0,u.has(e)&&(w=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=V[t];if(h.hasOwnProperty(t))continue;let i=!1;i=In(e)&&In(n)?!nr(e,n)||x:e!==n,i?null!=e?P(t):u.add(t):void 0!==e&&u.has(t)?P(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||s)&&t.blockInitialAnimation&&(T=!1);const M=v&&x;T&&(!M||w)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Fn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=fn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Fn(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ar(),s=!0}}},t.createAxis=Mo,t.createAxisDelta=Ao,t.createBox=Eo,t.createDelta=Po,t.createEffect=xi,t.createGeneratorEasing=mt,t.createProjectionNode=oa,t.createRenderBatcher=rt,t.cubicBezierAsString=Ye,t.defaultEasing=$t,t.defaultOffset=Nt,t.defaultTransformValue=xe,t.defaultValueTypes=ae,t.degrees=V,t.delay=Hr,t.delayInSeconds=function(t,n){return Hr(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=ei,t.eachAxis=Br,t.fillOffset=It,t.fillWildcards=he,t.findDimensionValueType=ni,t.findEffect=function(t){return ci.find(e=>e.test(t))},t.findValueType=t=>Qs.find(ti(t)),t.flushKeyframeResolvers=Oe,t.followValue=function(t,e){const n=vn(Wn(t)?t.get():t);return _s(n,t,e),n},t.frame=at,t.frameData=n,t.frameSteps=ct,t.generateLinearEasing=ht,t.getAnimatableNone=ue,t.getAnimationMap=function(t){let e=mn.get(t);return e||(e=new Map,mn.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Ne(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=Vn,t.getDefaultValueType=le,t.getFeatureDefinitions=function(){return Wo},t.getFinalKeyframe=Gt,t.getMixer=Q,t.getOptimisedAppearId=qn,t.getOriginIndex=Ws,t.getValueAsType=fi,t.getValueTransition=Tn,t.getVariableValue=Bn,t.getVariantContext=er,t.getViewAnimationLayerInfo=ho,t.getViewAnimations=po,t.globalProjectionState=Qr,t.handOffElementState=ds,t.has2DTranslate=Hi,t.hasComplexValues=O,t.hasReducedMotionListener=Io,t.hasScale=Xi,t.hasTransform=qi,t.hex=b,t.hover=function(t,e,n={}){const[i,s,o]=vs(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||gs())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=D,t.hslaToRgba=z,t.inertia=Ft,t.initPrefersReducedMotion=Uo,t.interpolate=Ot,t.invisibleValues=_,t.isAnimationControls=Do,t.isCSSVariableName=l,t.isCSSVariableToken=u,t.isControllingVariants=jo,t.isDeltaZero=Pr,t.isDragActive=gs,t.isDragging=ys,t.isElementKeyboardAccessible=bs,t.isElementTextInput=function(t){return Ss.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=Xo,t.isGenerator=_e,t.isHTMLElement=pi,t.isKeyframesTarget=In,t.isMotionValue=Wn,t.isNear=dr,t.isNodeOrChild=xs,t.isPrimaryPointer=Ts,t.isSVGElement=mi,t.isSVGSVGElement=$s,t.isSVGTag=Zo,t.isTransitionDefined=Pn,t.isVariantLabel=Co,t.isVariantNode=Lo,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ge()||!n||"string"==typeof n&&(n in Xe||Ge())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=zn,t.keyframes=Wt,t.makeAnimationInstant=sn,t.mapEasingToNativeEasing=qe,t.mapValue=function(t,e,n,i){const s=zs(e,n,i);return Zs(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=ls(t,n),{scroll:s}=e;return s&&(ss(i.x,s.offset.x),ss(i.y,s.offset.y)),i},t.measureViewportBox=ls,t.microtask=ms,t.mix=st,t.mixArray=tt,t.mixColor=H,t.mixComplex=nt,t.mixImmediate=K,t.mixLinearColor=Y,t.mixNumber=G,t.mixObject=et,t.mixValues=Ur,t.mixVisibility=Z,t.motionValue=vn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ra);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=p,t.numberValueTypes=re,t.optimizedAppearDataAttribute=Xn,t.optimizedAppearDataId=Yn,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:yi(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=Rn,t.parseValueFromTransform=Te,t.percent=A,t.pixelsToPercent=jr,t.positionalKeys=On,t.prefersReducedMotion=Oo,t.press=function(t,e,n={}){const[i,s,o]=vs(t,n),r=t=>{const i=t.currentTarget;if(!Ms(t))return;if(Es.has(t))return;Vs.add(i),n.stopPropagation&&Es.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Vs.has(i)&&Vs.delete(i),Ms(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||xs(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),pi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=As(()=>{if(Vs.has(n))return;Ps(n,"down");const t=As(()=>{Ps(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ps(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),bs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=k,t.propEffect=ps,t.propagateDirtyNodes=la,t.px=P,t.readSVGValue=Ui,t.readStyleValue=Ai,t.readTransformValue=we,t.recordStats=function(){if(Us.value)throw Us.value=null,Us.addProjectionMetrics=null,new Error("Stats are already being measured");const t=Us;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Tr,t.removeAxisTransforms=wr,t.removeBoxTransforms=Vr,t.removeEffect=ui,t.removePointDelta=xr,t.renderHTML=Go,t.renderSVG=Jo,t.resize=function(t,e){return"function"==typeof t?Ns(t):Fs(t,e)},t.resolveElements=yi,t.resolveMotionValue=_r,t.resolveTransition=xn,t.resolveVariant=Fn,t.resolveVariantFromProps=Ln,t.rgbUnit=T,t.rgba=w,t.rootProjectionNode=Ba,t.scale=f,t.scaleCorrectors=Yo,t.scalePoint=Zi,t.scrapeHTMLMotionValuesFromProps=qo,t.scrapeSVGMotionValuesFromProps=Qo,t.setDragLock=function(t){return"x"===t||"y"===t?ys[t]?null:(ys[t]=!0,()=>{ys[t]=!1}):ys.x||ys.y?null:(ys.x=ys.y=!0,()=>{ys.x=ys.y=!1})},t.setFeatureDefinitions=function(t){Wo=t},t.setStyle=Ue,t.setTarget=$n,t.spring=Lt,t.springValue=function(t,e){const n=vn(Wn(t)?t.get():t);return Js(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:Ws(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=He,t.statsBuffer=Us,t.styleEffect=Mi,t.styleSubjectEffect=Pi,t.supportedWaapiEasing=Xe,t.supportsBrowserAnimation=cn,t.supportsFlags=$e,t.supportsLinearEasing=Ge,t.supportsPartialKeyframes=li,t.supportsScrollTimeline=ze,t.supportsViewTimeline=Ke,t.svgEffect=Wi,t.svgSubjectEffect=$i,t.sync=za,t.testValueType=ti,t.time=o,t.transform=zs,t.transformAxis=os,t.transformBox=as,t.transformBoxPoints=Gi,t.transformPropOrder=Se,t.transformProps=Ve,t.transformValue=Zs,t.transformValueTypes=oe,t.translateAxis=ss,t.updateMotionValuesFromProps=Fo,t.variantPriorityOrder=Ro,t.variantProps=Bo,t.vh=M,t.visualElementStore=ko,t.vw=E});
|