naria-ui 0.1.28 → 0.1.30
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/components/{Chat/Chat.d.ts → Button/Button.d.ts} +1 -1
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/naria-ui.cjs.js +4 -12
- package/dist/naria-ui.es.js +183 -5131
- package/package.json +2 -13
- package/dist/components/Chat/generateResponse.d.ts +0 -6
- package/dist/components/Chat/index.d.ts +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Button: React.FC;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './Button';
|
package/dist/naria-ui.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("react");var T={exports:{}},R={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var I;function te(){if(I)return R;I=1;var s=Symbol.for("react.transitional.element"),_=Symbol.for("react.fragment");function f(d,a,u){var m=null;if(u!==void 0&&(m=""+u),a.key!==void 0&&(m=""+a.key),"key"in a){u={};for(var E in a)E!=="key"&&(u[E]=a[E])}else u=a;return a=u.ref,{$$typeof:s,type:d,key:m,ref:a!==void 0?a:null,props:u}}return R.Fragment=_,R.jsx=f,R.jsxs=f,R}var b={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var $;function ne(){return $||($=1,process.env.NODE_ENV!=="production"&&function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case z:return"Profiler";case q:return"StrictMode";case X:return"Suspense";case B:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case V:return(e.displayName||"Context")+".Provider";case J:return(e._context.displayName||"Context")+".Consumer";case G:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case x:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function _(e){return""+e}function f(e){try{_(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),_(e)}}function d(e){if(e===p)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===x)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=k.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function m(e){if(h.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function E(e,r){function t(){y||(y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function L(){var e=s(this.type);return N[e]||(N[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function U(e,r,t,n,l,c,A,S){return t=c.ref,e={$$typeof:w,type:e,key:r,props:c,_owner:l},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:L}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,r,t,n,l,c,A,S){var o=r.children;if(o!==void 0)if(n)if(K(o)){for(n=0;n<o.length;n++)g(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(o);if(h.call(r,"key")){o=s(e);var i=Object.keys(r).filter(function(ee){return ee!=="key"});n=0<i.length?"{key: someKey, "+i.join(": ..., ")+": ...}":"{key: someKey}",F[o+n]||(i=0<i.length?"{"+i.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,N,_,yt,_),gt[_+N]=!0)}if(_=null,M!==void 0&&(n(M),_=""+M),r(V)&&(n(V.key),_=""+V.key),"key"in V){M={};for(var xe in V)xe!=="key"&&(M[xe]=V[xe])}else M=V;return _&&a(M,typeof m=="function"?m.displayName||m.name||"Unknown":m),c(m,_,J,it,i(),M,ye,ve)}function h(m){typeof m=="object"&&m!==null&&m.$$typeof===d&&m._store&&(m._store.validated=1)}var f=T,d=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),v=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),Z=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mt=Object.prototype.hasOwnProperty,me=Array.isArray,pt=console.createTask?console.createTask:function(){return null};f={"react-stack-bottom-frame":function(m){return m()}};var pe,ge={},F=f["react-stack-bottom-frame"].bind(f,o)(),z=pt(s(o)),gt={};kt.Fragment=y,kt.jsx=function(m,V,M,N,it){var J=1e4>Z.recentlyCreatedOwnerStacks++;return u(m,V,M,!1,N,it,J?Error("react-stack-top-frame"):F,J?pt(s(m)):z)},kt.jsxs=function(m,V,M,N,it){var J=1e4>Z.recentlyCreatedOwnerStacks++;return u(m,V,M,!0,N,it,J?Error("react-stack-top-frame"):F,J?pt(s(m)):z)}}()),kt}var Bn;function jr(){return Bn||(Bn=1,process.env.NODE_ENV==="production"?qt.exports=kr():qt.exports=Lr()),qt.exports}var E=jr();const Qe=T.createContext({});function tn(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}const en=typeof window<"u",Qs=en?T.useLayoutEffect:T.useEffect,ce=T.createContext(null);function nn(t,e){t.indexOf(e)===-1&&t.push(e)}function sn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const et=(t,e,n)=>n>e?e:n<t?t:n;let Vt=()=>{},nt=()=>{};process.env.NODE_ENV!=="production"&&(Vt=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},nt=(t,e)=>{if(!t)throw new Error(e)});const st={},ti=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ei(t){return typeof t=="object"&&t!==null}const ni=t=>/^0[^.\s]+$/u.test(t);function rn(t){let e;return()=>(e===void 0&&(e=t()),e)}const H=t=>t,Or=(t,e)=>n=>e(t(n)),Yt=(...t)=>t.reduce(Or),Nt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class on{constructor(){this.subscriptions=[]}add(e){return nn(this.subscriptions,e),()=>sn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,Q=t=>t/1e3;function si(t,e){return e?t*(1e3/e):0}const In=new Set;function an(t,e,n){t||In.has(e)||(console.warn(e),In.add(e))}const ii=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fr=1e-7,Br=12;function Ir(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=ii(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Fr&&++a<Br);return r}function Gt(t,e,n,s){if(t===e&&n===s)return H;const i=o=>Ir(o,0,1,t,n);return o=>o===0||o===1?o:ii(i(o),e,s)}const ri=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,oi=t=>e=>1-t(1-e),ai=Gt(.33,1.53,.69,.99),ln=oi(ai),li=ri(ln),ui=t=>(t*=2)<1?.5*ln(t):.5*(2-Math.pow(2,-10*(t-1))),un=t=>1-Math.sin(Math.acos(t)),ci=oi(un),hi=ri(un),Nr=Gt(.42,0,1,1),_r=Gt(0,0,.58,1),fi=Gt(.42,0,.58,1),Ur=t=>Array.isArray(t)&&typeof t[0]!="number",di=t=>Array.isArray(t)&&typeof t[0]=="number",Nn={linear:H,easeIn:Nr,easeInOut:fi,easeOut:_r,circIn:un,circInOut:hi,circOut:ci,backIn:ln,backInOut:li,backOut:ai,anticipate:ui},$r=t=>typeof t=="string",_n=t=>{if(di(t)){nt(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return Gt(e,n,s,i)}else if($r(t))return nt(Nn[t]!==void 0,`Invalid easing type '${t}'`),Nn[t];return t},Zt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Un={value:null};function Wr(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(h){r.has(h)&&(u.schedule(h),t()),l++,h(a)}const u={schedule:(h,f=!1,d=!1)=>{const y=d&&i?n:s;return f&&r.add(h),y.has(h)||y.add(h),h},cancel:h=>{s.delete(h),r.delete(h)},process:h=>{if(a=h,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),e&&Un.value&&Un.value.frameloop[e].push(l),l=0,n.clear(),i=!1,o&&(o=!1,u.process(h))}};return u}const Kr=40;function mi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Zt.reduce((v,C)=>(v[C]=Wr(o,e?C:void 0),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:p}=r,y=()=>{const v=st.useManualTiming?i.timestamp:performance.now();n=!1,st.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Kr),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(y))},x=()=>{n=!0,s=!0,i.isProcessing||t(y)};return{schedule:Zt.reduce((v,C)=>{const b=r[C];return v[C]=(w,R=!1,A=!1)=>(n||x(),b.schedule(w,R,A)),v},{}),cancel:v=>{for(let C=0;C<Zt.length;C++)r[Zt[C]].cancel(v)},state:i,steps:r}}const{schedule:L,cancel:ot,state:B,steps:Te}=mi(typeof requestAnimationFrame<"u"?requestAnimationFrame:H,!0);let ee;function zr(){ee=void 0}const K={now:()=>(ee===void 0&&K.set(B.isProcessing||st.useManualTiming?B.timestamp:performance.now()),ee),set:t=>{ee=t,queueMicrotask(zr)}},pi=t=>e=>typeof e=="string"&&e.startsWith(t),cn=pi("--"),Yr=pi("var(--"),hn=t=>Yr(t)?Gr.test(t.split("/*")[0].trim()):!1,Gr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ct={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},_t={...Ct,transform:t=>et(0,1,t)},Jt={...Ct,default:1},Ot=t=>Math.round(t*1e5)/1e5,fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hr(t){return t==null}const Xr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dn=(t,e)=>n=>!!(typeof n=="string"&&Xr.test(n)&&n.startsWith(t)||e&&!Hr(n)&&Object.prototype.hasOwnProperty.call(n,e)),gi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(fn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},qr=t=>et(0,255,t),be={...Ct,transform:t=>Math.round(qr(t))},ht={test:dn("rgb","red"),parse:gi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+be.transform(t)+", "+be.transform(e)+", "+be.transform(n)+", "+Ot(_t.transform(s))+")"};function Zr(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ke={test:dn("#"),parse:Zr,transform:ht.transform},Ht=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),rt=Ht("deg"),tt=Ht("%"),P=Ht("px"),Jr=Ht("vh"),Qr=Ht("vw"),$n={...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(t*100)},vt={test:dn("hsl","hue"),parse:gi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+tt.transform(Ot(e))+", "+tt.transform(Ot(n))+", "+Ot(_t.transform(s))+")"},U={test:t=>ht.test(t)||ke.test(t)||vt.test(t),parse:t=>ht.test(t)?ht.parse(t):vt.test(t)?vt.parse(t):ke.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):vt.transform(t)},to=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function eo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(fn))==null?void 0:e.length)||0)+(((n=t.match(to))==null?void 0:n.length)||0)>0}const yi="number",vi="color",no="var",so="var(",Wn="${}",io=/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 Ut(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(io,l=>(U.test(l)?(s.color.push(o),i.push(vi),n.push(U.parse(l))):l.startsWith(so)?(s.var.push(o),i.push(no),n.push(l)):(s.number.push(o),i.push(yi),n.push(parseFloat(l))),++o,Wn)).split(Wn);return{values:n,split:a,indexes:s,types:i}}function xi(t){return Ut(t).values}function Ti(t){const{split:e,types:n}=Ut(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===yi?o+=Ot(i[r]):a===vi?o+=U.transform(i[r]):o+=i[r]}return o}}const ro=t=>typeof t=="number"?0:t;function oo(t){const e=xi(t);return Ti(t)(e.map(ro))}const at={test:eo,parse:xi,createTransformer:Ti,getAnimatableNone:oo};function Se(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ao({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Se(l,a,t+1/3),o=Se(l,a,t),r=Se(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function re(t,e){return n=>n>0?e:t}const k=(t,e,n)=>t+(e-t)*n,Pe=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},lo=[ke,ht,vt],uo=t=>lo.find(e=>e.test(t));function Kn(t){const e=uo(t);if(Vt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===vt&&(n=ao(n)),n}const zn=(t,e)=>{const n=Kn(t),s=Kn(e);if(!n||!s)return re(t,e);const i={...n};return o=>(i.red=Pe(n.red,s.red,o),i.green=Pe(n.green,s.green,o),i.blue=Pe(n.blue,s.blue,o),i.alpha=k(n.alpha,s.alpha,o),ht.transform(i))},Le=new Set(["none","hidden"]);function co(t,e){return Le.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ho(t,e){return n=>k(t,e,n)}function mn(t){return typeof t=="number"?ho:typeof t=="string"?hn(t)?re:U.test(t)?zn:po:Array.isArray(t)?bi:typeof t=="object"?U.test(t)?zn:fo:re}function bi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>mn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function fo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=mn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function mo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const po=(t,e)=>{const n=at.createTransformer(e),s=Ut(t),i=Ut(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Le.has(t)&&!i.values.length||Le.has(e)&&!s.values.length?co(t,e):Yt(bi(mo(s,i),i.values),n):(Vt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),re(t,e))};function Si(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?k(t,e,n):mn(t)(t,e)}const go=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>ot(e),now:()=>B.isProcessing?B.timestamp:K.now()}},Pi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(o/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},oe=2e4;function pn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<oe;)e+=n,s=t.next(e);return e>=oe?1/0:e}function yo(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(pn(s),oe);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:Q(i)}}const vo=5;function wi(t,e,n){const s=Math.max(e-vo,0);return si(n-t(s),e-s)}const D={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Yn=.001;function xo({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,o;Vt(t<=q(D.maxDuration),"Spring duration must be 10 seconds or less");let r=1-e;r=et(D.minDamping,D.maxDamping,r),t=et(D.minDuration,D.maxDuration,Q(t)),r<1?(i=c=>{const u=c*r,h=u*t,f=u-n,d=je(c,r),p=Math.exp(-h);return Yn-f/d*p},o=c=>{const h=c*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(c,2)*t,p=Math.exp(-h),y=je(Math.pow(c,2),r);return(-i(c)+Yn>0?-1:1)*((f-d)*p)/y}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-.001+u*h},o=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=bo(i,o,a);if(t=q(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const To=12;function bo(t,e,n){let s=n;for(let i=1;i<To;i++)s=s-t(s)/e(s);return s}function je(t,e){return t*Math.sqrt(1-e*e)}const So=["duration","bounce"],Po=["stiffness","damping","mass"];function Gn(t,e){return e.some(n=>t[n]!==void 0)}function wo(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!Gn(t,Po)&&Gn(t,So))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*et(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:o}}else{const n=xo(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function ae(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=wo({...n,velocity:-Q(n.velocity||0)}),p=f||0,y=c/(2*Math.sqrt(l*u)),x=r-o,g=Q(Math.sqrt(l/u)),S=Math.abs(x)<5;s||(s=S?D.restSpeed.granular:D.restSpeed.default),i||(i=S?D.restDelta.granular:D.restDelta.default);let v;if(y<1){const b=je(g,y);v=w=>{const R=Math.exp(-y*g*w);return r-R*((p+y*g*x)/b*Math.sin(b*w)+x*Math.cos(b*w))}}else if(y===1)v=b=>r-Math.exp(-g*b)*(x+(p+g*x)*b);else{const b=g*Math.sqrt(y*y-1);v=w=>{const R=Math.exp(-y*g*w),A=Math.min(b*w,300);return r-R*((p+y*g*x)*Math.sinh(A)+b*x*Math.cosh(A))/b}}const C={calculatedDuration:d&&h||null,next:b=>{const w=v(b);if(d)a.done=b>=h;else{let R=b===0?p:0;y<1&&(R=b===0?q(p):wi(v,b,w));const A=Math.abs(R)<=s,O=Math.abs(r-w)<=i;a.done=A&&O}return a.value=a.done?r:w,a},toString:()=>{const b=Math.min(pn(C),oe),w=Pi(R=>C.next(b*R).value,b,30);return b+"ms "+w},toTransition:()=>{}};return C}ae.applyToOptions=t=>{const e=yo(t,100,ae);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};function Oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let y=n*e;const x=h+y,g=r===void 0?x:r(x);g!==x&&(y=g-h);const S=A=>-y*Math.exp(-A/s),v=A=>g+S(A),C=A=>{const O=S(A),I=v(A);f.done=Math.abs(O)<=c,f.value=f.done?g:I};let b,w;const R=A=>{d(f.value)&&(b=A,w=ae({keyframes:[f.value,p(f.value)],velocity:wi(v,A,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return R(0),{calculatedDuration:null,next:A=>{let O=!1;return!w&&b===void 0&&(O=!0,C(A),R(A)),b!==void 0&&A>=b?w.next(A-b):(!O&&C(A),f)}}}function Ao(t,e,n){const s=[],i=n||st.mix||Si,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||H:e;a=Yt(l,a)}s.push(a)}return s}function Vo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(nt(o===e.length,"Both input and output ranges must be the same length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ao(e,s,i),l=a.length,c=u=>{if(r&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Nt(t[h],t[h+1],u);return a[h](f)};return n?u=>c(et(t[0],t[o-1],u)):c}function Co(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Nt(0,e,s);t.push(k(n,1,i))}}function Eo(t){const e=[0];return Co(e,t.length-1),e}function Ro(t,e){return t.map(n=>n*e)}function Mo(t,e){return t.map(()=>e||fi).splice(0,t.length-1)}function xt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Ur(s)?s.map(_n):_n(s),o={done:!1,value:e[0]},r=Ro(n&&n.length===e.length?n:Eo(e),t),a=Vo(r,e,{ease:Array.isArray(i)?i:Mo(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Do=t=>t!==null;function gn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Do),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const ko={decay:Oe,inertia:Oe,tween:xt,keyframes:xt,spring:ae};function Ai(t){typeof t.type=="string"&&(t.type=ko[t.type])}class yn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Lo=t=>t/100;class vn extends yn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==K.now()&&this.tick(K.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ai(e);const{type:n=xt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||xt;process.env.NODE_ENV!=="production"&&l!==xt&&nt(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),l!==xt&&typeof a[0]!="number"&&(this.mixKeyframes=Yt(Lo,Si(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=pn(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,C=s;if(h){const A=Math.min(this.currentTime,i)/a;let O=Math.floor(A),I=A%1;!I&&A>=1&&(I=1),I===1&&O--,O=Math.min(O,h+1),!!(O%2)&&(f==="reverse"?(I=1-I,d&&(I-=d/a)):f==="mirror"&&(C=r)),v=et(0,1,I)*a}const b=S?{done:!1,value:u[0]}:C.next(v);o&&(b.value=o(b.value));let{done:w}=b;!S&&l!==null&&(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&w);return R&&p!==Oe&&(b.value=gn(u,this.options,x,this.speed)),y&&y(b.value),R&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return Q(this.calculatedDuration)}get time(){return Q(this.currentTime)}set time(e){var n;e=q(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(K.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Q(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:e=go,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),(o=(i=this.options).onPlay)==null||o.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(K.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function jo(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,Fe=t=>{const e=ft(Math.atan2(t[1],t[0]));return Be(e)},Oo={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fe,rotateZ:Fe,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>(t=t%360,t<0&&(t+=360),t),Hn=Fe,Xn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),qn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fo={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xn,scaleY:qn,scale:t=>(Xn(t)+qn(t))/2,rotateX:t=>Be(ft(Math.atan2(t[6],t[5]))),rotateY:t=>Be(ft(Math.atan2(-t[2],t[0]))),rotateZ:Hn,rotate:Hn,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function Ne(t,e){if(!t||t==="none")return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Fo,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Oo,i=a}if(!i)return Ie(e);const o=s[e],r=i[1].split(",").map(Io);return typeof o=="function"?o(r):r[o]}const Bo=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ne(n,e)};function Io(t){return parseFloat(t.trim())}const Et=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rt=new Set(Et),Zn=t=>t===Ct||t===P,No=new Set(["x","y","z"]),_o=Et.filter(t=>!No.has(t));function Uo(t){const e=[];return _o.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const dt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ne(e,"x"),y:(t,{transform:e})=>Ne(e,"y")};dt.translateX=dt.x;dt.translateY=dt.y;const mt=new Set;let _e=!1,Ue=!1,$e=!1;function Vi(){if(Ue){const t=Array.from(mt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Uo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))==null||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ue=!1,_e=!1,mt.forEach(t=>t.complete($e)),mt.clear()}function Ci(){mt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ue=!0)})}function $o(){$e=!0,Ci(),Vi(),$e=!1}class xn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),_e||(_e=!0,L.read(Ci),L.resolveKeyframes(Vi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i==null?void 0:i.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}jo(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Wo=t=>t.startsWith("--");function Ko(t,e,n){Wo(e)?t.style.setProperty(e,n):t.style[e]=n}const zo=rn(()=>window.ScrollTimeline!==void 0),Yo={};function Go(t,e){const n=rn(t);return()=>Yo[e]??n()}const Ei=Go(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Ri(t,e){if(t)return typeof t=="function"?Ei()?Pi(t,e):"ease-out":di(t)?jt(t):Array.isArray(t)?t.map(n=>Ri(n,e)||Jn.easeOut):Jn[t]}function Ho(t,e,n,{delay:s=0,duration:i=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=Ri(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function Mi(t){return typeof t=="function"&&"applyToOptions"in t}function Xo({type:t,...e}){return Mi(t)&&Ei()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class qo extends yn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,nt(typeof e.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const c=Xo(e);this.animation=Ho(n,s,i,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=gn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Ko(n,s,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return Q(Number(e))}get time(){return Q(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=q(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&zo()?(this.animation.timeline=e,H):n(this)}}const Di={anticipate:ui,backInOut:li,circInOut:hi};function Zo(t){return t in Di}function Jo(t){typeof t.ease=="string"&&Zo(t.ease)&&(t.ease=Di[t.ease])}const Qn=10;class Qo extends qo{constructor(e){Jo(e),Ai(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new vn({...r,autoplay:!1}),l=q(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Qn).value,a.sample(l).value,Qn),a.stop()}}const ts=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(at.test(t)||t==="0")&&!t.startsWith("url("));function ta(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ea(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=ts(i,e),a=ts(o,e);return Vt(r===a,`You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!r||!a?!1:ta(t)||(n==="spring"||Mi(n))&&s}function Tn(t){return ei(t)&&"offsetHeight"in t}const na=new Set(["opacity","clipPath","filter","transform"]),sa=rn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ia(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!Tn((c=e==null?void 0:e.owner)==null?void 0:c.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return sa()&&n&&na.has(n)&&(n!=="transform"||!l)&&!a&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const ra=40;class oa extends yn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var p;super(),this.stop=()=>{var y,x;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=K.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||xn;this.keyframeResolver=new d(a,(y,x,g)=>this.onKeyframesResolved(y,x,f,!g),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=K.now(),ea(e,o,r,a)||((st.instantAnimations||!l)&&(u==null||u(gn(e,s,n))),e[0]=e[e.length-1],s.duration=0,s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ra?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&ia(f)?new Qo({...f,element:f.motionValue.owner.current}):new vn(f);d.finished.then(()=>this.notifyFinished()).catch(H),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),$o()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const aa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function la(t){const e=aa.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ua=4;function ki(t,e,n=1){nt(n<=ua,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=la(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return ti(r)?parseFloat(r):r}return hn(i)?ki(i,e,n+1):i}function bn(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const Li=new Set(["width","height","top","left","right","bottom",...Et]),ca={test:t=>t==="auto",parse:t=>t},ji=t=>e=>e.test(t),Oi=[Ct,P,tt,rt,Qr,Jr,ca],es=t=>Oi.find(ji(t));function ha(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ni(t):!0}const fa=new Set(["brightness","contrast","saturate","opacity"]);function da(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(fn)||[];if(!s)return t;const i=n.replace(s,"");let o=fa.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const ma=/\b([a-z-]*)\(.*?\)/gu,We={...at,getAnimatableNone:t=>{const e=t.match(ma);return e?e.map(da).join(" "):t}},ns={...Ct,transform:Math.round},pa={rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scale:Jt,scaleX:Jt,scaleY:Jt,scaleZ:Jt,skew:rt,skewX:rt,skewY:rt,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:_t,originX:$n,originY:$n,originZ:P},Sn={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius: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,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,backgroundPositionX:P,backgroundPositionY:P,...pa,zIndex:ns,fillOpacity:_t,strokeOpacity:_t,numOctaves:ns},ga={...Sn,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:We,WebkitFilter:We},Fi=t=>ga[t];function Bi(t,e){let n=Fi(t);return n!==We&&(n=at),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ya=new Set(["auto","none","0"]);function va(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!ya.has(o)&&Ut(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Bi(n,i)}class xa extends xn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),hn(c))){const u=ki(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Li.has(s)||e.length!==2)return;const[i,o]=e,r=es(i),a=es(o);if(r!==a)if(Zn(r)&&Zn(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else dt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ha(e[i]))&&s.push(i);s.length&&va(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=dt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=dt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Ta(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const Ii=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ss=30,ba=t=>!isNaN(parseFloat(t));class Sa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{var r,a;const o=K.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty();i&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=K.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ba(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&an(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new on);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=K.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ss)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ss);return si(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new Sa(t,e)}const{schedule:Pn}=mi(queueMicrotask,!1),X={x:!1,y:!1};function Ni(){return X.x||X.y}function Pa(t){return t==="x"||t==="y"?X[t]?null:(X[t]=!0,()=>{X[t]=!1}):X.x||X.y?null:(X.x=X.y=!0,()=>{X.x=X.y=!1})}function _i(t,e){const n=Ta(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function is(t){return!(t.pointerType==="touch"||Ni())}function wa(t,e,n={}){const[s,i,o]=_i(t,n),r=a=>{if(!is(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{is(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Ui=(t,e)=>e?t===e?!0:Ui(t,e.parentElement):!1,wn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Aa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Va(t){return Aa.has(t.tagName)||t.tabIndex!==-1}const ne=new WeakSet;function rs(t){return e=>{e.key==="Enter"&&t(e)}}function we(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ca=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=rs(()=>{if(ne.has(n))return;we(n,"down");const i=rs(()=>{we(n,"up")}),o=()=>we(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function os(t){return wn(t)&&!Ni()}function Ea(t,e,n={}){const[s,i,o]=_i(t,n),r=a=>{const l=a.currentTarget;if(!os(a))return;ne.add(l);const c=e(l,a),u=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),ne.has(l)&&ne.delete(l),os(d)&&typeof c=="function"&&c(d,{success:p})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Ui(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Tn(a)&&(a.addEventListener("focus",c=>Ca(c,i)),!Va(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function $i(t){return ei(t)&&"ownerSVGElement"in t}function Ra(t){return $i(t)&&t.tagName==="svg"}const $=t=>!!(t&&t.getVelocity),Ma=[...Oi,U,at],Da=t=>Ma.find(ji(t)),An=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class ka extends Je.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=Tn(s)&&s.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function La({children:t,isPresent:e,anchorX:n}){const s=T.useId(),i=T.useRef(null),o=T.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:r}=T.useContext(An);return T.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:h}=o.current;if(e||!i.current||!a||!l)return;const f=n==="left"?`left: ${u}`:`right: ${h}`;i.current.dataset.motionPopId=s;const d=document.createElement("style");return r&&(d.nonce=r),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
|
|
23
|
-
[data-motion-pop-id="${s}"] {
|
|
24
|
-
position: absolute !important;
|
|
25
|
-
width: ${a}px !important;
|
|
26
|
-
height: ${l}px !important;
|
|
27
|
-
${f}px !important;
|
|
28
|
-
top: ${c}px !important;
|
|
29
|
-
}
|
|
30
|
-
`),()=>{document.head.contains(d)&&document.head.removeChild(d)}},[e]),E.jsx(ka,{isPresent:e,childRef:i,sizeRef:o,children:Je.cloneElement(t,{ref:i})})}const ja=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a})=>{const l=tn(Oa),c=T.useId();let u=!0,h=T.useMemo(()=>(u=!1,{id:c,initial:e,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const d of l.values())if(!d)return;s&&s()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,s]);return o&&u&&(h={...h}),T.useMemo(()=>{l.forEach((f,d)=>l.set(d,!1))},[n]),Je.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),r==="popLayout"&&(t=E.jsx(La,{isPresent:n,anchorX:a,children:t})),E.jsx(ce.Provider,{value:h,children:t})};function Oa(){return new Map}function Wi(t=!0){const e=T.useContext(ce);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=T.useId();T.useEffect(()=>{if(t)return i(o)},[t]);const r=T.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Qt=t=>t.key||"";function as(t){const e=[];return T.Children.forEach(t,n=>{T.isValidElement(n)&&e.push(n)}),e}const Fa=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left"})=>{const[l,c]=Wi(r),u=T.useMemo(()=>as(t),[t]),h=r&&!l?[]:u.map(Qt),f=T.useRef(!0),d=T.useRef(u),p=tn(()=>new Map),[y,x]=T.useState(u),[g,S]=T.useState(u);Qs(()=>{f.current=!1,d.current=u;for(let b=0;b<g.length;b++){const w=Qt(g[b]);h.includes(w)?p.delete(w):p.get(w)!==!0&&p.set(w,!1)}},[g,h.length,h.join("-")]);const v=[];if(u!==y){let b=[...u];for(let w=0;w<g.length;w++){const R=g[w],A=Qt(R);h.includes(A)||(b.splice(w,0,R),v.push(R))}return o==="wait"&&v.length&&(b=v),S(as(b)),x(u),null}process.env.NODE_ENV!=="production"&&o==="wait"&&g.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=T.useContext(Qe);return E.jsx(E.Fragment,{children:g.map(b=>{const w=Qt(b),R=r&&!l?!1:u===g||h.includes(w),A=()=>{if(p.has(w))p.set(w,!0);else return;let O=!0;p.forEach(I=>{I||(O=!1)}),O&&(C==null||C(),S(d.current),r&&(c==null||c()),s&&s())};return E.jsx(ja,{isPresent:R,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,onExitComplete:R?void 0:A,anchorX:a,children:b},w)})})},Ki=T.createContext({strict:!1}),ls={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},At={};for(const t in ls)At[t]={isEnabled:e=>ls[t].some(n=>!!e[n])};function Ba(t){for(const e in t)At[e]={...At[e],...t[e]}}const Ia=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function le(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ia.has(t)}let zi=t=>!le(t);function Na(t){t&&(zi=e=>e.startsWith("on")?!le(e):t(e))}try{Na(require("@emotion/is-prop-valid").default)}catch{}function _a(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(zi(i)||n===!0&&le(i)||!e&&!le(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Ua(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&an(!1,"motion() is deprecated. Use motion.create() instead."),t(...s));return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const he=T.createContext({});function fe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $t(t){return typeof t=="string"||Array.isArray(t)}const Vn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cn=["initial",...Vn];function de(t){return fe(t.animate)||Cn.some(e=>$t(t[e]))}function Yi(t){return!!(de(t)||t.variants)}function $a(t,e){if(de(t)){const{initial:n,animate:s}=t;return{initial:n===!1||$t(n)?n:void 0,animate:$t(s)?s:void 0}}return t.inherit!==!1?e:{}}function Wa(t){const{initial:e,animate:n}=$a(t,T.useContext(he));return T.useMemo(()=>({initial:e,animate:n}),[us(e),us(n)])}function us(t){return Array.isArray(t)?t.join(" "):t}const Ka=Symbol.for("motionComponentSymbol");function Tt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function za(t,e,n){return T.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Tt(n)&&(n.current=s))},[e])}const En=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ya="framerAppearId",Gi="data-"+En(Ya),Hi=T.createContext({});function Ga(t,e,n,s,i){var y,x;const{visualElement:o}=T.useContext(he),r=T.useContext(Ki),a=T.useContext(ce),l=T.useContext(An).reducedMotion,c=T.useRef(null);s=s||r.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,h=T.useContext(Hi);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Ha(c.current,n,i,h);const f=T.useRef(!1);T.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const d=n[Gi],p=T.useRef(!!d&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,d))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,d)));return Qs(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),Pn.render(u.render),p.current&&u.animationState&&u.animationState.animateChanges())}),T.useEffect(()=>{u&&(!p.current&&u.animationState&&u.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,d)}),p.current=!1))}),u}function Ha(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Xi(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&Tt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:l,layoutRoot:c})}function Xi(t){if(t)return t.options.allowProjection!==!1?t.projection:Xi(t.parent)}function Xa({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Ba(t);function o(a,l){let c;const u={...T.useContext(An),...a,layoutId:qa(a)},{isStatic:h}=u,f=Wa(a),d=s(a,h);if(!h&&en){Za(u,t);const p=Ja(u);c=p.MeasureLayout,f.visualElement=Ga(i,d,u,e,p.ProjectionNode)}return E.jsxs(he.Provider,{value:f,children:[c&&f.visualElement?E.jsx(c,{visualElement:f.visualElement,...u}):null,n(i,a,za(d,f.visualElement,l),d,h,f.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const r=T.forwardRef(o);return r[Ka]=i,r}function qa({layoutId:t}){const e=T.useContext(Qe).id;return e&&t!==void 0?e+"-"+t:t}function Za(t,e){const n=T.useContext(Ki).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Vt(!1,s):nt(!1,s)}}function Ja(t){const{drag:e,layout:n}=At;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Wt={};function Qa(t){for(const e in t)Wt[e]=t[e],cn(e)&&(Wt[e].isCSSVariable=!0)}function qi(t,{layout:e,layoutId:n}){return Rt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wt[t]||t==="opacity")}const tl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},el=Et.length;function nl(t,e,n){let s="",i=!0;for(let o=0;o<el;o++){const r=Et[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ii(a,Sn[r]);if(!l){i=!1;const u=tl[r]||r;s+=`${u}(${c}) `}n&&(e[r]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Rn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const c=e[l];if(Rt.has(l)){r=!0;continue}else if(cn(l)){i[l]=c;continue}else{const u=Ii(c,Sn[l]);l.startsWith("origin")?(a=!0,o[l]=u):s[l]=u}}if(e.transform||(r||n?s.transform=nl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;s.transformOrigin=`${l} ${c} ${u}`}}const Mn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zi(t,e,n){for(const s in e)!$(e[s])&&!qi(s,n)&&(t[s]=e[s])}function sl({transformTemplate:t},e){return T.useMemo(()=>{const n=Mn();return Rn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function il(t,e){const n=t.style||{},s={};return Zi(s,n,t),Object.assign(s,sl(t,e)),s}function rl(t,e){const n={},s=il(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const ol={offset:"stroke-dashoffset",array:"stroke-dasharray"},al={offset:"strokeDashoffset",array:"strokeDasharray"};function ll(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?ol:al;t[o.offset]=P.transform(-s);const r=P.transform(e),a=P.transform(n);t[o.array]=`${r} ${a}`}function Ji(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Rn(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&ll(h,i,o,r,!1)}const Qi=()=>({...Mn(),attrs:{}}),tr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ul(t,e,n,s){const i=T.useMemo(()=>{const o=Qi();return Ji(o,e,tr(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Zi(o,t.style,t),i.style={...o,...i.style}}return i}const cl=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dn(t){return typeof t!="string"||t.includes("-")?!1:!!(cl.indexOf(t)>-1||/[A-Z]/u.test(t))}function hl(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Dn(n)?ul:rl)(s,o,r,n),c=_a(s,typeof n=="string",t),u=n!==T.Fragment?{...c,...l,ref:i}:{},{children:h}=s,f=T.useMemo(()=>$(h)?h.get():h,[h]);return T.createElement(n,{...u,children:f})}}function cs(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function kn(t,e,n,s){if(typeof e=="function"){const[i,o]=cs(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=cs(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function se(t){return $(t)?t.get():t}function fl({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:dl(n,s,i,t),renderState:e()}}const er=t=>(e,n)=>{const s=T.useContext(he),i=T.useContext(ce),o=()=>fl(t,e,s,i);return n?o():tn(o)};function dl(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=se(o[f]);let{initial:r,animate:a}=t;const l=de(t),c=Yi(t);e&&c&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const h=u?a:r;if(h&&typeof h!="boolean"&&!fe(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=kn(t,f[d]);if(p){const{transitionEnd:y,transition:x,...g}=p;for(const S in g){let v=g[S];if(Array.isArray(v)){const C=u?v.length-1:0;v=v[C]}v!==null&&(i[S]=v)}for(const S in y)i[S]=y[S]}}}return i}function Ln(t,e,n){var o;const{style:s}=t,i={};for(const r in s)($(s[r])||e.style&&$(e.style[r])||qi(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(i[r]=s[r]);return i}const ml={useVisualState:er({scrapeMotionValuesFromProps:Ln,createRenderState:Mn})};function nr(t,e,n){const s=Ln(t,e,n);for(const i in t)if($(t[i])||$(e[i])){const o=Et.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}const pl={useVisualState:er({scrapeMotionValuesFromProps:nr,createRenderState:Qi})};function gl(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...Dn(s)?pl:ml,preloadedFeatures:t,useRender:hl(i),createVisualElement:e,Component:s};return Xa(r)}}function Kt(t,e,n){const s=t.getProps();return kn(s,e,n!==void 0?n:s.custom,t)}const Ke=t=>Array.isArray(t);function yl(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function vl(t){return Ke(t)?t[t.length-1]||0:t}function xl(t,e){const n=Kt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=vl(o[r]);yl(t,r,a)}}function Tl(t){return!!($(t)&&t.add)}function ze(t,e){const n=t.getValue("willChange");if(Tl(n))return n.add(e);if(!n&&st.WillChange){const s=new st.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function sr(t){return t.props[Gi]}const bl=t=>t!==null;function Sl(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bl),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}const Pl={type:"spring",stiffness:500,damping:25,restSpeed:10},wl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Al={type:"keyframes",duration:.8},Vl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cl=(t,{keyframes:e})=>e.length>2?Al:Rt.has(t)?t.startsWith("scale")?wl(e[1]):Pl:Vl;function El({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const jn=(t,e,n,s={},i,o)=>r=>{const a=bn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-q(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};El(a)||Object.assign(u,Cl(t,u)),u.duration&&(u.duration=q(u.duration)),u.repeatDelay&&(u.repeatDelay=q(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),(st.instantAnimations||st.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Sl(u.keyframes,a);if(f!==void 0){L.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new vn(u):new oa(u)};function Rl({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ir(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;s&&(o=s);const l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const u in a){const h=t.getValue(u,t.latestValues[u]??null),f=a[u];if(f===void 0||c&&Rl(c,u))continue;const d={delay:n,...bn(o||{},u)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===p&&!d.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const g=sr(t);if(g){const S=window.MotionHandoffAnimation(g,u,L);S!==null&&(d.startTime=S,y=!0)}}ze(t,u),h.start(jn(u,h,f,t.shouldReduceMotion&&Li.has(u)?{type:!1}:d,t,y));const x=h.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{L.update(()=>{r&&xl(t,r)})}),l}function Ye(t,e,n={}){var l;const s=Kt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(ir(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return Ml(t,e,u+c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function Ml(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(c=0)=>c*s:(c=0)=>a-c*s;return Array.from(t.variantChildren).sort(Dl).forEach((c,u)=>{c.notify("AnimationStart",e),r.push(Ye(c,e,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(r)}function Dl(t,e){return t.sortNodePosition(e)}function kl(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Ye(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Ye(t,e,n);else{const i=typeof e=="function"?Kt(t,e,n.custom):e;s=Promise.all(ir(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function rr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Ll=Cn.length;function or(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?or(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Ll;n++){const s=Cn[n],i=t.props[s];($t(i)||i===!1)&&(e[s]=i)}return e}const jl=[...Vn].reverse(),Ol=Vn.length;function Fl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>kl(t,n,s)))}function Bl(t){let e=Fl(t),n=hs(),s=!0;const i=l=>(c,u)=>{var f;const h=Kt(t,u,l==="exit"?(f=t.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:d,transitionEnd:p,...y}=h;c={...c,...y,...p}}return c};function o(l){e=l(t)}function r(l){const{props:c}=t,u=or(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let x=0;x<Ol;x++){const g=jl[x],S=n[g],v=c[g]!==void 0?c[g]:u[g],C=$t(v),b=g===l?S.isActive:null;b===!1&&(p=x);let w=v===u[g]&&v!==c[g]&&C;if(w&&s&&t.manuallyAnimateOnMount&&(w=!1),S.protectedKeys={...d},!S.isActive&&b===null||!v&&!S.prevProp||fe(v)||typeof v=="boolean")continue;const R=Il(S.prevProp,v);let A=R||g===l&&S.isActive&&!w&&C||x>p&&C,O=!1;const I=Array.isArray(v)?v:[v];let Z=I.reduce(i(g),{});b===!1&&(Z={});const{prevResolvedValues:Mt={}}=S,me={...Mt,...Z},pt=F=>{A=!0,f.has(F)&&(O=!0,f.delete(F)),S.needsAnimating[F]=!0;const z=t.getValue(F);z&&(z.liveStyle=!1)};for(const F in me){const z=Z[F],gt=Mt[F];if(d.hasOwnProperty(F))continue;let m=!1;Ke(z)&&Ke(gt)?m=!rr(z,gt):m=z!==gt,m?z!=null?pt(F):f.add(F):z!==void 0&&f.has(F)?pt(F):S.protectedKeys[F]=!0}S.prevProp=v,S.prevResolvedValues=Z,S.isActive&&(d={...d,...Z}),s&&t.blockInitialAnimation&&(A=!1),A&&(!(w&&R)||O)&&h.push(...I.map(F=>({animation:F,options:{type:g}})))}if(f.size){const x={};if(typeof c.initial!="boolean"){const g=Kt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(x.transition=g.transition)}f.forEach(g=>{const S=t.getBaseTarget(g),v=t.getValue(g);v&&(v.liveStyle=!0),x[g]=S??null}),h.push({animation:x})}let y=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,y?e(h):Promise.resolve()}function a(l,c){var h;if(n[l].isActive===c)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(f=>{var d;return(d=f.animationState)==null?void 0:d.setActive(l,c)}),n[l].isActive=c;const u=r(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=hs(),s=!0}}}function Il(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!rr(e,t):!1}function ut(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hs(){return{animate:ut(!0),whileInView:ut(),whileHover:ut(),whileTap:ut(),whileDrag:ut(),whileFocus:ut(),exit:ut()}}class lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Nl extends lt{constructor(e){super(e),e.animationState||(e.animationState=Bl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();fe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let _l=0;class Ul extends lt{constructor(){super(...arguments),this.id=_l++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const $l={animation:{Feature:Nl},exit:{Feature:Ul}};function zt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Xt(t){return{point:{x:t.pageX,y:t.pageY}}}const Wl=t=>e=>wn(e)&&t(e,Xt(e));function Ft(t,e,n,s){return zt(t,e,Wl(n),s)}function ar({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Kl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function zl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const lr=1e-4,Yl=1-lr,Gl=1+lr,ur=.01,Hl=0-ur,Xl=0+ur;function W(t){return t.max-t.min}function ql(t,e,n){return Math.abs(t-e)<=n}function fs(t,e,n,s=.5){t.origin=s,t.originPoint=k(e.min,e.max,t.origin),t.scale=W(n)/W(e),t.translate=k(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Yl&&t.scale<=Gl||isNaN(t.scale))&&(t.scale=1),(t.translate>=Hl&&t.translate<=Xl||isNaN(t.translate))&&(t.translate=0)}function Bt(t,e,n,s){fs(t.x,e.x,n.x,s?s.originX:void 0),fs(t.y,e.y,n.y,s?s.originY:void 0)}function ds(t,e,n){t.min=n.min+e.min,t.max=t.min+W(e)}function Zl(t,e,n){ds(t.x,e.x,n.x),ds(t.y,e.y,n.y)}function ms(t,e,n){t.min=e.min-n.min,t.max=t.min+W(e)}function It(t,e,n){ms(t.x,e.x,n.x),ms(t.y,e.y,n.y)}const ps=()=>({translate:0,scale:1,origin:0,originPoint:0}),bt=()=>({x:ps(),y:ps()}),gs=()=>({min:0,max:0}),j=()=>({x:gs(),y:gs()});function G(t){return[t("x"),t("y")]}function Ae(t){return t===void 0||t===1}function Ge({scale:t,scaleX:e,scaleY:n}){return!Ae(t)||!Ae(e)||!Ae(n)}function ct(t){return Ge(t)||cr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function cr(t){return ys(t.x)||ys(t.y)}function ys(t){return t&&t!=="0%"}function ue(t,e,n){const s=t-n,i=e*s;return n+i}function vs(t,e,n,s,i){return i!==void 0&&(t=ue(t,i,s)),ue(t,n,s)+e}function He(t,e=0,n=1,s,i){t.min=vs(t.min,e,n,s,i),t.max=vs(t.max,e,n,s,i)}function hr(t,{x:e,y:n}){He(t.x,e.translate,e.scale,e.originPoint),He(t.y,n.translate,n.scale,n.originPoint)}const xs=.999999999999,Ts=1.0000000000001;function Jl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Pt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,hr(t,r)),s&&ct(o.latestValues)&&Pt(t,o.latestValues))}e.x<Ts&&e.x>xs&&(e.x=1),e.y<Ts&&e.y>xs&&(e.y=1)}function St(t,e){t.min=t.min+e,t.max=t.max+e}function bs(t,e,n,s,i=.5){const o=k(t.min,t.max,i);He(t,e,n,o,s)}function Pt(t,e){bs(t.x,e.x,e.scaleX,e.scale,e.originX),bs(t.y,e.y,e.scaleY,e.scale,e.originY)}function fr(t,e){return ar(zl(t.getBoundingClientRect(),e))}function Ql(t,e,n){const s=fr(t,n),{scroll:i}=e;return i&&(St(s.x,i.offset.x),St(s.y,i.offset.y)),s}const dr=({current:t})=>t?t.ownerDocument.defaultView:null,Ss=(t,e)=>Math.abs(t-e);function tu(t,e){const n=Ss(t.x,e.x),s=Ss(t.y,e.y);return Math.sqrt(n**2+s**2)}class mr{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Ce(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=tu(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:p}=h,{timestamp:y}=B;this.history.push({...p,timestamp:y});const{onStart:x,onMove:g}=this.handlers;f||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ve(f,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:p,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ce(h.type==="pointercancel"?this.lastMoveEventInfo:Ve(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,x),p&&p(h,x)},!wn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Xt(e),a=Ve(r,this.transformPagePoint),{point:l}=a,{timestamp:c}=B;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Ce(a,this.history)),this.removeListeners=Yt(Ft(this.contextWindow,"pointermove",this.handlePointerMove),Ft(this.contextWindow,"pointerup",this.handlePointerUp),Ft(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ot(this.updatePoint)}}function Ve(t,e){return e?{point:e(t.point)}:t}function Ps(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ce({point:t},e){return{point:t,delta:Ps(t,pr(e)),offset:Ps(t,eu(e)),velocity:nu(e,.1)}}function eu(t){return t[0]}function pr(t){return t[t.length-1]}function nu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=pr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};const o=Q(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function su(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?k(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?k(n,t,s.max):Math.min(t,n)),t}function ws(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function iu(t,{top:e,left:n,bottom:s,right:i}){return{x:ws(t.x,n,i),y:ws(t.y,e,s)}}function As(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function ru(t,e){return{x:As(t.x,e.x),y:As(t.y,e.y)}}function ou(t,e){let n=.5;const s=W(t),i=W(e);return i>s?n=Nt(e.min,e.max-s,t.min):s>i&&(n=Nt(t.min,t.max-i,e.min)),et(0,1,n)}function au(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Xe=.35;function lu(t=Xe){return t===!1?t=0:t===!0&&(t=Xe),{x:Vs(t,"left","right"),y:Vs(t,"top","bottom")}}function Vs(t,e,n){return{min:Cs(t,e),max:Cs(t,n)}}function Cs(t,e){return typeof t=="number"?t:t[e]||0}const uu=new WeakMap;class cu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=j(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Xt(u).point)},o=(u,h)=>{const{drag:f,dragPropagation:d,onDragStart:p}=this.getProps();if(f&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Pa(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),G(x=>{let g=this.getAxisMotionValue(x).get()||0;if(tt.test(g)){const{projection:S}=this.visualElement;if(S&&S.layout){const v=S.layout.layoutBox[x];v&&(g=W(v)*(parseFloat(g)/100))}}this.originPoint[x]=g}),p&&L.postRender(()=>p(u,h)),ze(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},r=(u,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:p,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:x}=h;if(d&&this.currentDirection===null){this.currentDirection=hu(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),y&&y(u,h)},a=(u,h)=>this.stop(u,h),l=()=>G(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)==null?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new mr(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:dr(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!te(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=su(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&&Tt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=iu(s.layoutBox,e):this.constraints=!1,this.elastic=lu(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&G(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=au(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Tt(e))return!1;const s=e.current;nt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Ql(s,i.root,this.visualElement.getTransformPagePoint());let r=ru(i.layout.layoutBox,o);if(n){const a=n(Kl(r));this.hasMutatedConstraints=!!a,a&&(r=ar(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=G(u=>{if(!te(u,n,this.currentDirection))return;let h=l&&l[u]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return ze(this.visualElement,e),s.start(jn(e,s,0,n,this.visualElement,!1))}stopAnimation(){G(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){G(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){G(n=>{const{drag:s}=this.getProps();if(!te(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-k(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Tt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};G(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=ou({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),G(r=>{if(!te(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(k(l,c,i[r]))})}addListeners(){if(!this.visualElement.current)return;uu.set(this.visualElement,this);const e=this.visualElement.current,n=Ft(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Tt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(s);const r=zt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(G(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function te(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function hu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class fu extends lt{constructor(e){super(e),this.removeGroupControls=H,this.removeListeners=H,this.controls=new cu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H}unmount(){this.removeGroupControls(),this.removeListeners()}}const Es=t=>(e,n)=>{t&&L.postRender(()=>t(e,n))};class du extends lt{constructor(){super(...arguments),this.removePointerDownListener=H}onPointerDown(e){this.session=new mr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:dr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Es(e),onStart:Es(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&L.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Ft(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ie={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=Rs(t,e.target.x),s=Rs(t,e.target.y);return`${n}% ${s}%`}},mu={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=at.parse(t);if(i.length>5)return s;const o=at.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const c=k(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}};class pu extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Qa(gu),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ie.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||L.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Pn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function gr(t){const[e,n]=Wi(),s=T.useContext(Qe);return E.jsx(pu,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(Hi),isPresent:e,safeToRemove:n})}const gu={borderRadius:{...Lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomLeftRadius:Lt,borderBottomRightRadius:Lt,boxShadow:mu};function yu(t,e,n){const s=$(t)?t:wt(t);return s.start(jn("",s,e,n)),s.animation}const vu=(t,e)=>t.depth-e.depth;class xu{constructor(){this.children=[],this.isDirty=!1}add(e){nn(this.children,e),this.isDirty=!0}remove(e){sn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(vu),this.isDirty=!1,this.children.forEach(e)}}function Tu(t,e){const n=K.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(ot(s),t(o-e))};return L.setup(s,!0),()=>ot(s)}const yr=["TopLeft","TopRight","BottomLeft","BottomRight"],bu=yr.length,Ms=t=>typeof t=="string"?parseFloat(t):t,Ds=t=>typeof t=="number"||P.test(t);function Su(t,e,n,s,i,o){i?(t.opacity=k(0,n.opacity??1,Pu(s)),t.opacityExit=k(e.opacity??1,0,wu(s))):o&&(t.opacity=k(e.opacity??1,n.opacity??1,s));for(let r=0;r<bu;r++){const a=`border${yr[r]}Radius`;let l=ks(e,a),c=ks(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ds(l)===Ds(c)?(t[a]=Math.max(k(Ms(l),Ms(c),s),0),(tt.test(c)||tt.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=k(e.rotate||0,n.rotate||0,s))}function ks(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Pu=vr(0,.5,ci),wu=vr(.5,.95,H);function vr(t,e,n){return s=>s<t?0:s>e?1:n(Nt(t,e,s))}function Ls(t,e){t.min=e.min,t.max=e.max}function Y(t,e){Ls(t.x,e.x),Ls(t.y,e.y)}function js(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Os(t,e,n,s,i){return t-=e,t=ue(t,1/n,s),i!==void 0&&(t=ue(t,1/i,s)),t}function Au(t,e=0,n=1,s=.5,i,o=t,r=t){if(tt.test(e)&&(e=parseFloat(e),e=k(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=k(o.min,o.max,s);t===o&&(a-=e),t.min=Os(t.min,e,n,a,i),t.max=Os(t.max,e,n,a,i)}function Fs(t,e,[n,s,i],o,r){Au(t,e[n],e[s],e[i],e.scale,o,r)}const Vu=["x","scaleX","originX"],Cu=["y","scaleY","originY"];function Bs(t,e,n,s){Fs(t.x,e,Vu,n?n.x:void 0,s?s.x:void 0),Fs(t.y,e,Cu,n?n.y:void 0,s?s.y:void 0)}function Is(t){return t.translate===0&&t.scale===1}function xr(t){return Is(t.x)&&Is(t.y)}function Ns(t,e){return t.min===e.min&&t.max===e.max}function Eu(t,e){return Ns(t.x,e.x)&&Ns(t.y,e.y)}function _s(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Tr(t,e){return _s(t.x,e.x)&&_s(t.y,e.y)}function Us(t){return W(t.x)/W(t.y)}function $s(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ru{constructor(){this.members=[]}add(e){nn(this.members,e),e.scheduleRender()}remove(e){if(sn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Mu(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Ee=["","X","Y","Z"],Du={visibility:"hidden"},ku=1e3;let Lu=0;function Re(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function br(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=sr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&br(s)}function Sr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=Lu++,this.animationId=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,this.nodes.forEach(Fu),this.nodes.forEach(Uu),this.nodes.forEach($u),this.nodes.forEach(Bu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new xu)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new on),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=$i(r)&&!Ra(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u;const h=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=Tu(h,250),ie.hasAnimatedSinceResize&&(ie.hasAnimatedSinceResize=!1,this.nodes.forEach(Ks))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Gu,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=c.getProps(),g=!this.targetLayout||!Tr(this.targetLayout,d),S=!h&&f;if(this.options.layoutRoot||this.resumeFrom||S||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...bn(p,"layout"),onPlay:y,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,S)}else h||Ks(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ot(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(Wu),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&br(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ws);return}this.isUpdating||this.nodes.forEach(Nu),this.isUpdating=!1,this.nodes.forEach(_u),this.nodes.forEach(ju),this.nodes.forEach(Ou),this.clearAllSnapshots();const a=K.now();B.delta=et(0,1e3/60,a-B.timestamp),B.timestamp=a,B.isProcessing=!0,Te.update.process(B),Te.preRender.process(B),Te.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Iu),this.sharedNodes.forEach(Ku)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!W(this.snapshot.measuredBox.x)&&!W(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=j(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xr(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||ct(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Hu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:r}=this.options;if(!r)return j();const a=r.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Xu))){const{scroll:u}=this.root;u&&(St(a.x,u.offset.x),St(a.y,u.offset.y))}return a}removeElementScroll(r){var l;const a=j();if(Y(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&Y(a,r),St(a.x,h.offset.x),St(a.y,h.offset.y))}return a}applyTransform(r,a=!1){const l=j();Y(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Pt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ct(u.latestValues)&&Pt(l,u.latestValues)}return ct(this.latestValues)&&Pt(l,this.latestValues),l}removeTransform(r){const a=j();Y(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ct(c.latestValues))continue;Ge(c.latestValues)&&c.updateSnapshot();const u=j(),h=c.measurePageBox();Y(u,h),Bs(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ct(this.latestValues)&&Bs(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}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!==B.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!(!this.layout||!(u||h))){if(this.resolvedRelativeTargetAt=B.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j(),this.relativeTargetOrigin=j(),It(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),Y(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=j(),this.targetWithTransforms=j()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Y(this.target,this.layout.layoutBox),hr(this.target,this.targetDelta)):Y(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j(),this.relativeTargetOrigin=j(),It(this.relativeTargetOrigin,this.target,d.target),Y(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ge(this.parent.latestValues)||cr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var p;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===B.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Y(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Jl(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=j());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(js(this.prevProjectionDelta.x,this.projectionDelta.x),js(this.prevProjectionDelta.y,this.projectionDelta.y)),Bt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!$s(this.projectionDelta.x,this.prevProjectionDelta.x)||!$s(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bt(),this.projectionDelta=bt(),this.projectionDeltaWithTransform=bt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=bt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=j(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,y=d!==p,x=this.getStack(),g=!x||x.members.length<=1,S=!!(y&&!g&&this.options.crossfade===!0&&!this.path.some(Yu));this.animationProgress=0;let v;this.mixTargetDelta=C=>{const b=C/1e3;zs(h.x,r.x,b),zs(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(It(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),zu(this.relativeTarget,this.relativeTargetOrigin,f,b),v&&Eu(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=j()),Y(v,this.relativeTarget)),y&&(this.animationValues=u,Su(u,c,this.latestValues,b,S,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(ot(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{ie.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wt(0)),this.currentAnimation=yu(this.motionValue,[0,1e3],{...r,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),r.onUpdate&&r.onUpdate(u)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ku),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&Pr(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||j();const h=W(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=W(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}Y(a,l),Pt(a,u),Bt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Ru),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Re("z",r,c,this.animationValues);for(let u=0;u<Ee.length;u++)Re(`rotate${Ee[u]}`,r,c,this.animationValues),Re(`skew${Ee[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}getProjectionStyles(r){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Du;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=se(r==null?void 0:r.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const d={};return this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=se(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!ct(this.latestValues)&&(d.transform=l?l({},""):"none",this.hasProjected=!1),d}const u=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=Mu(this.projectionDeltaWithTransform,this.treeScale,u),l&&(a.transform=l(u,a.transform));const{x:h,y:f}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const d in Wt){if(u[d]===void 0)continue;const{correct:p,applyTo:y,isCSSVariable:x}=Wt[d],g=a.transform==="none"?u[d]:p(u[d],c);if(y){const S=y.length;for(let v=0;v<S;v++)a[y[v]]=g}else x?this.options.visualElement.renderState.vars[d]=g:a[d]=g}return this.options.layoutId&&(a.pointerEvents=c===this?se(r==null?void 0:r.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Ws),this.root.sharedNodes.clear()}}}function ju(t){t.updateLayout()}function Ou(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?G(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=W(f);f.min=s[h].min,f.max=f.min+d}):Pr(o,e.layoutBox,s)&&G(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=W(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=bt();Bt(a,s,e.layoutBox);const l=bt();r?Bt(l,t.applyTransform(i,!0),e.measuredBox):Bt(l,s,e.layoutBox);const c=!xr(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=j();It(p,e.layoutBox,f.layoutBox);const y=j();It(y,s,d.layoutBox),Tr(p,y)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Fu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Bu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Iu(t){t.clearSnapshot()}function Ws(t){t.clearMeasurements()}function Nu(t){t.isLayoutDirty=!1}function _u(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ks(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Uu(t){t.resolveTargetDelta()}function $u(t){t.calcProjection()}function Wu(t){t.resetSkewAndRotation()}function Ku(t){t.removeLeadSnapshot()}function zs(t,e,n){t.translate=k(e.translate,0,n),t.scale=k(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ys(t,e,n,s){t.min=k(e.min,n.min,s),t.max=k(e.max,n.max,s)}function zu(t,e,n,s){Ys(t.x,e.x,n.x,s),Ys(t.y,e.y,n.y,s)}function Yu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Gu={duration:.45,ease:[.4,0,.1,1]},Gs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hs=Gs("applewebkit/")&&!Gs("chrome/")?Math.round:H;function Xs(t){t.min=Hs(t.min),t.max=Hs(t.max)}function Hu(t){Xs(t.x),Xs(t.y)}function Pr(t,e,n){return t==="position"||t==="preserve-aspect"&&!ql(Us(e),Us(n),.2)}function Xu(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const qu=Sr({attachResizeListener:(t,e)=>zt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Me={current:void 0},wr=Sr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Me.current){const t=new qu({});t.mount(window),t.setOptions({layoutScroll:!0}),Me.current=t}return Me.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Zu={pan:{Feature:du},drag:{Feature:fu,ProjectionNode:wr,MeasureLayout:gr}};function qs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&L.postRender(()=>o(e,Xt(e)))}class Ju extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=wa(e,(n,s)=>(qs(this.node,s,"Start"),i=>qs(this.node,i,"End"))))}unmount(){}}class Qu extends lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Yt(zt(this.node.current,"focus",()=>this.onFocus()),zt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&L.postRender(()=>o(e,Xt(e)))}class tc extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=Ea(e,(n,s)=>(Zs(this.node,s,"Start"),(i,{success:o})=>Zs(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const qe=new WeakMap,De=new WeakMap,ec=t=>{const e=qe.get(t.target);e&&e(t)},nc=t=>{t.forEach(ec)};function sc({root:t,...e}){const n=t||document;De.has(n)||De.set(n,{});const s=De.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(nc,{root:t,...e})),s[i]}function ic(t,e,n){const s=sc(e);return qe.set(t,n),s.observe(t),()=>{qe.delete(t),s.unobserve(t)}}const rc={some:0,all:1};class oc extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:rc[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=c?u:h;f&&f(l)};return ic(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(ac(e,n))&&this.startObserver()}unmount(){}}function ac({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const lc={inView:{Feature:oc},tap:{Feature:tc},focus:{Feature:Qu},hover:{Feature:Ju}},uc={layout:{ProjectionNode:wr,MeasureLayout:gr}},Ze={current:null},Ar={current:!1};function cc(){if(Ar.current=!0,!!en)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ze.current=t.matches;t.addListener(e),e()}else Ze.current=!1}const hc=new WeakMap;function fc(t,e,n){for(const s in e){const i=e[s],o=n[s];if($(i))t.addValue(s,i);else if($(o))t.addValue(s,wt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,wt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Js=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class dc{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=xn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=K.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,L.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=de(n),this.isVariantNode=Yi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&$(d)&&d.set(l[f],!1)}}mount(e){this.current=e,hc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Ar.current||cc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ze.current,process.env.NODE_ENV!=="production"&&an(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Rt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in At){const n=At[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):j()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Js.length;s++){const i=Js[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=fc(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=wt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ti(s)||ni(s))?s=parseFloat(s):!Da(s)&&at.test(n)&&(s=Bi(e,n)),this.setBaseTarget(e,$(s)?s.get():s)),$(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=kn(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!$(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new on),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Vr extends dc{constructor(){super(...arguments),this.KeyframeResolver=xa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;$(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Cr(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}function mc(t){return window.getComputedStyle(t)}class pc extends Vr{constructor(){super(...arguments),this.type="html",this.renderInstance=Cr}readValueFromInstance(e,n){var s;if(Rt.has(n))return(s=this.projection)!=null&&s.isProjecting?Ie(n):Bo(e,n);{const i=mc(e),o=(cn(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return fr(e,n)}build(e,n,s){Rn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ln(e,n,s)}}const Er=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function gc(t,e,n,s){Cr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Er.has(i)?i:En(i),e.attrs[i])}class yc extends Vr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=j}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Rt.has(n)){const s=Fi(n);return s&&s.default||0}return n=Er.has(n)?n:En(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return nr(e,n,s)}build(e,n,s){Ji(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){gc(e,n,s,i)}mount(e){this.isSVGTag=tr(e.tagName),super.mount(e)}}const vc=(t,e)=>Dn(t)?new yc(e):new pc(e,{allowProjection:t!==T.Fragment}),xc=gl({...$l,...lc,...Zu,...uc},vc),Tc=Ua(xc);async function Rr(t){const e=["😃","😂","🎉"],n=["😃","😂","🔥","🥳","😢","😎","🤔","🙌","💡","🎉"];let s=n;return t.toLowerCase().includes("happy")&&(s=n.filter(i=>e.includes(i))),{memes:[`Meme for: ${t}`,`Another meme about ${t}`],emojis:s,slogans:[`Stay ${t}!`,`Keep calm and be ${t}`]}}const bc=["Happy","Sad","Excited","Angry","Chill"],Sc=()=>{const[t,e]=T.useState(!1),[n,s]=T.useState(""),[i,o]=T.useState(!1),[r,a]=T.useState(null);return E.jsxs(E.Fragment,{children:[E.jsx("button",{style:{position:"fixed",bottom:24,right:24,zIndex:1e3,borderRadius:"50%",width:56,height:56,background:"#007bff",color:"#fff",border:"none",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",cursor:"pointer"},onClick:()=>e(!0),"aria-label":"Open chat",children:"💬"}),E.jsx(Fa,{children:t&&E.jsxs(Tc.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},style:{position:"fixed",bottom:90,right:24,width:320,background:"#fff",borderRadius:16,boxShadow:"0 4px 24px rgba(0,0,0,0.18)",padding:20,zIndex:1001},children:[E.jsx("button",{style:{position:"absolute",top:8,right:8,background:"none",border:"none",fontSize:18,cursor:"pointer"},onClick:()=>e(!1),"aria-label":"Close chat",children:"×"}),E.jsx("div",{style:{marginBottom:12},children:E.jsx("strong",{children:"How are you feeling?"})}),E.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:bc.map(l=>E.jsx("button",{style:{background:"#f1f1f1",border:"none",borderRadius:8,padding:"4px 12px",cursor:"pointer"},onClick:()=>s(l),children:l},l))}),E.jsxs("form",{onSubmit:async l=>{if(l.preventDefault(),!n.trim())return;o(!0),a(null);const c=await Rr(n);a(c),o(!1)},style:{display:"flex",gap:8},children:[E.jsx("input",{type:"text",value:n,onChange:l=>s(l.target.value),placeholder:"Type your mood...",style:{flex:1,borderRadius:8,border:"1px solid #ddd",padding:8}}),E.jsx("button",{type:"submit",style:{background:"#007bff",color:"#fff",border:"none",borderRadius:8,padding:"8px 16px",cursor:"pointer"},children:"Send"})]}),i&&E.jsx("div",{style:{marginTop:16},children:"Generating..."}),r&&E.jsxs("div",{style:{marginTop:16},children:[E.jsxs("div",{children:[E.jsx("strong",{children:"Memes:"})," ",r.memes.map((l,c)=>E.jsx("div",{children:l},c))]}),E.jsxs("div",{style:{marginTop:8},children:[E.jsx("strong",{children:"Emojis:"})," ",r.emojis.join(" ")]}),E.jsxs("div",{style:{marginTop:8},children:[E.jsx("strong",{children:"Slogans:"})," ",r.slogans.map((l,c)=>E.jsx("div",{children:l},c))]})]})]})})]})};function Pc(t){return t.charAt(0).toUpperCase()+t.slice(1)}exports.Chat=Sc;exports.capitalize=Pc;exports.generateResponse=Rr;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,o,i,o),F[o+n]=!0)}if(o=null,t!==void 0&&(f(t),o=""+t),m(r)&&(f(r.key),o=""+r.key),"key"in r){t={};for(var P in r)P!=="key"&&(t[P]=r[P])}else t=r;return o&&E(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),U(e,o,c,l,a(),t,A,S)}function g(e){typeof e=="object"&&e!==null&&e.$$typeof===w&&e._store&&(e._store.validated=1)}var v=re,w=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),V=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),k=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h=Object.prototype.hasOwnProperty,K=Array.isArray,O=console.createTask?console.createTask:function(){return null};v={"react-stack-bottom-frame":function(e){return e()}};var y,N={},C=v["react-stack-bottom-frame"].bind(v,u)(),Y=O(d(u)),F={};b.Fragment=p,b.jsx=function(e,r,t,n,l){var c=1e4>k.recentlyCreatedOwnerStacks++;return j(e,r,t,!1,n,l,c?Error("react-stack-top-frame"):C,c?O(d(e)):Y)},b.jsxs=function(e,r,t,n,l){var c=1e4>k.recentlyCreatedOwnerStacks++;return j(e,r,t,!0,n,l,c?Error("react-stack-top-frame"):C,c?O(d(e)):Y)}}()),b}var D;function oe(){return D||(D=1,process.env.NODE_ENV==="production"?T.exports=te():T.exports=ne()),T.exports}var M=oe();const ae=()=>M.jsx(M.Fragment,{});function se(s){return s.charAt(0).toUpperCase()+s.slice(1)}exports.Button=ae;exports.capitalize=se;
|