@ahmiao666/ahmiao-react-dialog-element
Version:
12 lines • 129 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).reactDialog={},t.React,t.ReactDOM)}(this,function(t,e,n){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var s,o=i(e),r={exports:{}},a={};var l,c={};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?r.exports=function(){if(s)return a;s=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(e,n,i){var s=null;if(void 0!==i&&(s=""+i),void 0!==n.key&&(s=""+n.key),"key"in n)for(var o in i={},n)"key"!==o&&(i[o]=n[o]);else i=n;return n=i.ref,{$$typeof:t,type:e,key:s,ref:void 0!==n?n:null,props:i}}return a.Fragment=e,a.jsx=n,a.jsxs=n,a}():r.exports=(l||(l=1,"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===E?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case m:return"Fragment";case y:return"Profiler";case f:return"StrictMode";case b:return"Suspense";case w:return"SuspenseList";case P:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case p:return"Portal";case v:return(e.displayName||"Context")+".Provider";case g:return(e._context.displayName||"Context")+".Consumer";case x:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(n=e.displayName||null)?n:t(e.type)||"Memo";case S:n=e._payload,e=e._init;try{return t(e(n))}catch(t){}}return null}function n(t){return""+t}function i(t){try{n(t);var e=!1}catch(t){e=!0}if(e){var i=(e=console).error,s="function"==typeof Symbol&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return i.call(e,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),n(t)}}function s(e){if(e===m)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===S)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch(t){return"<...>"}}function o(){return Error("react-stack-top-frame")}function r(){var e=t(this.type);return V[e]||(V[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.")),void 0!==(e=this.props.ref)?e:null}function a(e,n,s,o,a,c,h,p){var m,f=n.children;if(void 0!==f)if(o)if(M(f)){for(o=0;o<f.length;o++)l(f[o]);Object.freeze&&Object.freeze(f)}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 l(f);if(C.call(n,"key")){f=t(e);var y=Object.keys(n).filter(function(t){return"key"!==t});o=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",j[f+o]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',o,f,y,f),j[f+o]=!0)}if(f=null,void 0!==s&&(i(s),f=""+s),function(t){if(C.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(n)&&(i(n.key),f=""+n.key),"key"in n)for(var g in s={},n)"key"!==g&&(s[g]=n[g]);else s=n;return f&&function(t,e){function n(){u||(u=!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)",e))}n.isReactWarning=!0,Object.defineProperty(t,"key",{get:n,configurable:!0})}(s,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(t,e,n,i,s,o,a,l){return n=o.ref,t={$$typeof:d,type:t,key:e,props:o,_owner:s},null!==(void 0!==n?n:null)?Object.defineProperty(t,"ref",{enumerable:!1,get:r}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}(e,f,c,0,null===(m=A.A)?null:m.getOwner(),s,h,p)}function l(t){"object"==typeof t&&null!==t&&t.$$typeof===d&&t._store&&(t._store.validated=1)}var u,h=e,d=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),v=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),E=Symbol.for("react.client.reference"),A=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Object.prototype.hasOwnProperty,M=Array.isArray,k=console.createTask?console.createTask:function(){return null},V={},D=(h={react_stack_bottom_frame:function(t){return t()}}).react_stack_bottom_frame.bind(h,o)(),R=k(s(o)),j={};c.Fragment=m,c.jsx=function(t,e,n,i,o){var r=1e4>A.recentlyCreatedOwnerStacks++;return a(t,e,n,!1,0,o,r?Error("react-stack-top-frame"):D,r?k(s(t)):R)},c.jsxs=function(t,e,n,i,o){var r=1e4>A.recentlyCreatedOwnerStacks++;return a(t,e,n,!0,0,o,r?Error("react-stack-top-frame"):D,r?k(s(t)):R)}}()),c);var u=r.exports;const h=e.createContext({});function d(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const p="undefined"!=typeof window,m=p?e.useLayoutEffect:e.useEffect,f=e.createContext(null);function y(t,e){-1===t.indexOf(e)&&t.push(e)}function g(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const v=(t,e,n)=>n>e?e:n<t?t:n;function x(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let b=()=>{},w=()=>{};"production"!==process.env.NODE_ENV&&(b=(t,e,n)=>{t||"undefined"==typeof console||console.warn(x(e,n))},w=(t,e,n)=>{if(!t)throw new Error(x(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function P(t){return"object"==typeof t&&null!==t}const E=t=>/^0[^.\s]+$/u.test(t);function A(t){let e;return()=>(void 0===e&&(e=t()),e)}const C=t=>t,M=(t,e)=>n=>e(t(n)),k=(...t)=>t.reduce(M),V=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class D{constructor(){this.subscriptions=[]}add(t){return y(this.subscriptions,t),()=>g(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const R=t=>1e3*t,j=t=>t/1e3;function L(t,e){return e?t*(1e3/e):0}const O=new Set;function F(t,e,n){t||O.has(e)||(console.warn(x(e,n)),O.add(e))}const B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function I(t,e,n,i){if(t===e&&n===i)return C;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,U=t=>e=>1-t(1-e),$=I(.33,1.53,.69,.99),W=U($),_=N(W),z=t=>(t*=2)<1?.5*W(t):.5*(2-Math.pow(2,-10*(t-1))),Y=t=>1-Math.sin(Math.acos(t)),X=U(Y),K=N(Y),H=I(.42,0,1,1),q=I(0,0,.58,1),G=I(.42,0,.58,1),Z=t=>Array.isArray(t)&&"number"==typeof t[0],J={linear:C,easeIn:H,easeInOut:G,easeOut:q,circIn:Y,circInOut:K,circOut:X,backIn:W,backInOut:_,backOut:$,anticipate:z},Q=t=>{if(Z(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return I(e,n,i,s)}return"string"==typeof t?(w(void 0!==J[t],`Invalid easing type '${t}'`,"invalid-easing-type"),J[t]):t},tt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],et={value:null,addProjectionMetrics:null};function nt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=tt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&et.value&&et.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming?s.timestamp:performance.now();n=!1,T.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:tt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<tt.length;e++)r[tt[e]].cancel(t)},state:s,steps:r}}const{schedule:it,cancel:st,state:ot,steps:rt}=nt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:C,!0);let at;function lt(){at=void 0}const ct={now:()=>(void 0===at&&ct.set(ot.isProcessing||T.useManualTiming?ot.timestamp:performance.now()),at),set:t=>{at=t,queueMicrotask(lt)}},ut=t=>e=>"string"==typeof e&&e.startsWith(t),ht=ut("--"),dt=ut("var(--"),pt=t=>!!dt(t)&&mt.test(t.split("/*")[0].trim()),mt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ft={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},yt={...ft,transform:t=>v(0,1,t)},gt={...ft,default:1},vt=t=>Math.round(1e5*t)/1e5,xt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const bt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wt=(t,e)=>n=>Boolean("string"==typeof n&&bt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Tt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(xt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},St={...ft,transform:t=>Math.round((t=>v(0,255,t))(t))},Pt={test:wt("rgb","red"),parse:Tt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+St.transform(t)+", "+St.transform(e)+", "+St.transform(n)+", "+vt(yt.transform(i))+")"};const Et={test:wt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Pt.transform},At=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=At("deg"),Mt=At("%"),kt=At("px"),Vt=At("vh"),Dt=At("vw"),Rt=(()=>({...Mt,parse:t=>Mt.parse(t)/100,transform:t=>Mt.transform(100*t)}))(),jt={test:wt("hsl","hue"),parse:Tt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Mt.transform(vt(e))+", "+Mt.transform(vt(n))+", "+vt(yt.transform(i))+")"},Lt={test:t=>Pt.test(t)||Et.test(t)||jt.test(t),parse:t=>Pt.test(t)?Pt.parse(t):jt.test(t)?jt.parse(t):Et.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Pt.transform(t):jt.transform(t),getAnimatableNone:t=>{const e=Lt.parse(t);return e.alpha=0,Lt.transform(e)}},Ot=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ft="number",Bt="color",It=/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 Nt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(It,t=>(Lt.test(t)?(i.color.push(o),s.push(Bt),n.push(Lt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ft),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Ut(t){return Nt(t).values}function $t(t){const{split:e,types:n}=Nt(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===Ft?vt(t[o]):e===Bt?Lt.transform(t[o]):t[o]}return s}}const Wt=t=>"number"==typeof t?0:Lt.test(t)?Lt.getAnimatableNone(t):t;const _t={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(xt)?.length||0)+(t.match(Ot)?.length||0)>0},parse:Ut,createTransformer:$t,getAnimatableNone:function(t){const e=Ut(t);return $t(t)(e.map(Wt))}};function zt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yt(t,e){return n=>n>0?e:t}const Xt=(t,e,n)=>t+(e-t)*n,Kt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ht=[Et,Pt,jt];function qt(t){const e=(n=t,Ht.find(t=>t.test(n)));var n;if(b(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===jt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=zt(a,i,t+1/3),o=zt(a,i,t),r=zt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Gt=(t,e)=>{const n=qt(t),i=qt(e);if(!n||!i)return Yt(t,e);const s={...n};return t=>(s.red=Kt(n.red,i.red,t),s.green=Kt(n.green,i.green,t),s.blue=Kt(n.blue,i.blue,t),s.alpha=Xt(n.alpha,i.alpha,t),Pt.transform(s))},Zt=new Set(["none","hidden"]);function Jt(t,e){return n=>Xt(t,e,n)}function Qt(t){return"number"==typeof t?Jt:"string"==typeof t?pt(t)?Yt:Lt.test(t)?Gt:ne:Array.isArray(t)?te:"object"==typeof t?Lt.test(t)?Gt:ee:Yt}function te(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Qt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ee(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Qt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ne=(t,e)=>{const n=_t.createTransformer(e),i=Nt(t),s=Nt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Zt.has(t)&&!s.values.length||Zt.has(e)&&!i.values.length?function(t,e){return Zt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):k(te(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):(b(!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.`,"complex-values-different"),Yt(t,e))};function ie(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Xt(t,e,n);return Qt(t)(t,e)}const se=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>it.update(e,t),stop:()=>st(e),now:()=>ot.isProcessing?ot.timestamp:ct.now()}},oe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},re=2e4;function ae(t){let e=0;let n=t.next(e);for(;!n.done&&e<re;)e+=50,n=t.next(e);return e>=re?1/0:e}function le(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}const ce=100,ue=10,he=1,de=0,pe=800,me=.3,fe=.3,ye={granular:.01,default:2},ge={granular:.005,default:.5},ve=.01,xe=10,be=.05,we=1,Te=.001;function Se({duration:t=pe,bounce:e=me,velocity:n=de,mass:i=he}){let s,o;b(t<=R(xe),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=v(be,we,r),t=v(ve,xe,j(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Ee(e,r),l=Math.exp(-s);return Te-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=Ee(Math.pow(e,2),r);return(-s(e)+Te>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<Pe;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=R(t),isNaN(a))return{stiffness:ce,damping:ue,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Pe=12;function Ee(t,e){return t*Math.sqrt(1-e*e)}const Ae=["duration","bounce"],Ce=["stiffness","damping","mass"];function Me(t,e){return e.some(e=>void 0!==t[e])}function ke(t=fe,e=me){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:de,stiffness:ce,damping:ue,mass:he,isResolvedFromDuration:!1,...t};if(!Me(t,Ce)&&Me(t,Ae))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:he,stiffness:s,damping:o}}else{const n=Se(t);e={...e,...n,mass:he},e.isResolvedFromDuration=!0}return e}({...n,velocity:-j(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),y=r-o,g=j(Math.sqrt(l/u)),x=Math.abs(y)<5;let b;if(i||(i=x?ye.granular:ye.default),s||(s=x?ge.granular:ge.default),f<1){const t=Ee(g,f);b=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===f)b=t=>r-Math.exp(-g*t)*(y+(m+g*y)*t);else{const t=g*Math.sqrt(f*f-1);b=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*y)*Math.sinh(i)+t*y*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=b(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?R(m):le(b,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ae(w),re),e=oe(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let b,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=ke({keyframes:[d.value,p(d.value)],velocity:le(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),T(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function De(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||ie,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||C:e;o=k(t,o)}i.push(o)}return i}(e,i,s),l=a.length,c=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=V(t[i],t[i+1],n);return a[i](s)};return n?e=>c(v(t[0],t[o-1],e)):c}function Re(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=V(0,e,i);t.push(Xt(n,1,s))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Q):Q(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Re(e),t),a=De(r,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map(()=>c||G).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}ke.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(ae(i),re);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:j(s)}}(t,100,ke);return t.ease=e.ease,t.duration=R(e.duration),t.type="keyframes",t};const Le=t=>null!==t;function Oe(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Le),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Fe={decay:Ve,inertia:Ve,tween:je,keyframes:je,spring:ke};function Be(t){"string"==typeof t.type&&(t.type=Fe[t.type])}class Ie{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ne=t=>t/100;class Ue extends Ie{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ct.now()&&this.tick(ct.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Be(t);const{type:e=je,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;"production"!==process.env.NODE_ENV&&a!==je&&w(r.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`,"spring-two-frames"),a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Ne,ie(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ae(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,b=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(b=o)),x=v(0,1,n)*r}const w=g?{done:!1,value:c[0]}:b.next(x);s&&(w.value=s(w.value));let{done:T}=w;g||null===a||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&p!==Ve&&(w.value=Oe(c,this.options,f,this.speed)),m&&m(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return j(this.calculatedDuration)}get time(){return j(this.currentTime)}set time(t){t=R(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ct.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=se,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ct.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const $e=t=>180*t/Math.PI,We=t=>{const e=$e(Math.atan2(t[1],t[0]));return ze(e)},_e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:We,rotateZ:We,skewX:t=>$e(Math.atan(t[1])),skewY:t=>$e(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ze=t=>((t%=360)<0&&(t+=360),t),Ye=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ke={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ye,scaleY:Xe,scale:t=>(Ye(t)+Xe(t))/2,rotateX:t=>ze($e(Math.atan2(t[6],t[5]))),rotateY:t=>ze($e(Math.atan2(-t[2],t[0]))),rotateZ:We,rotate:We,skewX:t=>$e(Math.atan(t[4])),skewY:t=>$e(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function He(t){return t.includes("scale")?1:0}function qe(t,e){if(!t||"none"===t)return He(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Ke,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=_e,s=e}if(!s)return He(e);const o=i[e],r=s[1].split(",").map(Ge);return"function"==typeof o?o(r):r[o]}function Ge(t){return parseFloat(t.trim())}const Ze=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Je=(()=>new Set(Ze))(),Qe=t=>t===ft||t===kt,tn=new Set(["x","y","z"]),en=Ze.filter(t=>!tn.has(t));const nn={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})=>qe(e,"x"),y:(t,{transform:e})=>qe(e,"y")};nn.translateX=nn.x,nn.translateY=nn.y;const sn=new Set;let on=!1,rn=!1,an=!1;function ln(){if(rn){const t=Array.from(sn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return en.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}rn=!1,on=!1,sn.forEach(t=>t.complete(an)),sn.clear()}function cn(){sn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(rn=!0)})}class un{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(sn.add(this),on||(on=!0,it.read(cn),it.resolveKeyframes(ln))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),sn.delete(this)}cancel(){"scheduled"===this.state&&(sn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const hn=A(()=>void 0!==window.ScrollTimeline),dn={};function pn(t,e){const n=A(t);return()=>dn[e]??n()}const mn=pn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),fn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,yn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function gn(t,e){return t?"function"==typeof t?mn()?oe(t,e):"ease-out":Z(t)?fn(t):Array.isArray(t)?t.map(t=>gn(t,e)||yn.easeOut):yn[t]:void 0}function vn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=gn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function xn(t){return"function"==typeof t&&"applyToOptions"in t}class bn extends Ie{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return xn(t)&&mn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=vn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Oe(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return j(Number(t))}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=R(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&hn()?(this.animation.timeline=t,C):e(this)}}const wn={anticipate:z,backInOut:_,circInOut:K};function Tn(t){"string"==typeof t.ease&&t.ease in wn&&(t.ease=wn[t.ease])}class Sn extends bn{constructor(t){Tn(t),Be(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ue({...o,autoplay:!1}),a=R(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const Pn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!_t.test(t)&&"0"!==t||t.startsWith("url(")));function En(t){t.duration=0,t.type}const An=new Set(["opacity","clipPath","filter","transform"]),Cn=A(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Mn extends Ie{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ct.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||un;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=ct.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Pn(s,e),a=Pn(o,e);return b(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||xn(n))&&i)}(t,s,o,r)||(!T.instantAnimations&&a||c?.(Oe(t,n,e)),t[0]=t[t.length-1],En(n),n.repeat=0);const u={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Cn()&&n&&An.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new Sn({...u,element:u.motionValue.owner.current}):new Ue(u);h.finished.then(()=>this.notifyFinished()).catch(C),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),an=!0,cn(),ln(),an=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const kn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vn(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=kn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return pt(s)?Vn(s,e,n+1):s}function Dn(t,e){return t?.[e]??t?.default??t}const Rn=new Set(["width","height","top","left","right","bottom",...Ze]),jn=t=>e=>e.test(t),Ln=[ft,kt,Mt,Ct,Dt,Vt,{test:t=>"auto"===t,parse:t=>t}],On=t=>Ln.find(jn(t));function Fn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||E(t))}const Bn=new Set(["brightness","contrast","saturate","opacity"]);function In(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(xt)||[];if(!i)return t;const s=n.replace(i,"");let o=Bn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Nn=/\b([a-z-]*)\(.*?\)/gu,Un={..._t,getAnimatableNone:t=>{const e=t.match(Nn);return e?e.map(In).join(" "):t}},$n={...ft,transform:Math.round},Wn={borderWidth:kt,borderTopWidth:kt,borderRightWidth:kt,borderBottomWidth:kt,borderLeftWidth:kt,borderRadius:kt,radius:kt,borderTopLeftRadius:kt,borderTopRightRadius:kt,borderBottomRightRadius:kt,borderBottomLeftRadius:kt,width:kt,maxWidth:kt,height:kt,maxHeight:kt,top:kt,right:kt,bottom:kt,left:kt,padding:kt,paddingTop:kt,paddingRight:kt,paddingBottom:kt,paddingLeft:kt,margin:kt,marginTop:kt,marginRight:kt,marginBottom:kt,marginLeft:kt,backgroundPositionX:kt,backgroundPositionY:kt,...{rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:Ct,skewX:Ct,skewY:Ct,distance:kt,translateX:kt,translateY:kt,translateZ:kt,x:kt,y:kt,z:kt,perspective:kt,transformPerspective:kt,opacity:yt,originX:Rt,originY:Rt,originZ:kt},zIndex:$n,fillOpacity:yt,strokeOpacity:yt,numOctaves:$n},_n={...Wn,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Un,WebkitFilter:Un},zn=t=>_n[t];function Yn(t,e){let n=zn(t);return n!==Un&&(n=_t),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Xn=new Set(["auto","none","0"]);class Kn extends un{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),pt(i))){const s=Vn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Rn.has(n)||2!==t.length)return;const[i,s]=t,o=On(i),r=On(s);if(o!==r)if(Qe(o)&&Qe(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else nn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Fn(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Xn.has(e)&&Nt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Yn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=nn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Hn=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function qn(t){return P(t)&&"offsetHeight"in t}class Gn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=ct.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=ct.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&F(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new D);const n=this.events[t].add(e);return"change"===t?()=>{n(),it.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ct.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return L(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zn(t,e){return new Gn(t,e)}const{schedule:Jn,cancel:Qn}=nt(queueMicrotask,!1),ti={x:!1,y:!1};function ei(){return ti.x||ti.y}function ni(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function ii(t){return!("touch"===t.pointerType||ei())}const si=(t,e)=>!!e&&(t===e||si(t,e.parentElement)),oi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ai=new WeakSet;function li(t){return e=>{"Enter"===e.key&&t(e)}}function ci(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ui(t){return oi(t)&&!ei()}function hi(t,e,n={}){const[i,s,o]=ni(t,n),r=t=>{const i=t.currentTarget;if(!ui(t))return;ai.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ai.has(i)&&ai.delete(i),ui(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||si(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),qn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=li(()=>{if(ai.has(n))return;ci(n,"down");const t=li(()=>{ci(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ci(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),e=t,ri.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function di(t){return P(t)&&"ownerSVGElement"in t}const pi=t=>Boolean(t&&t.getVelocity),mi=[...Ln,Lt,_t],fi=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class yi extends o.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=qn(t)&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function gi({children:t,isPresent:n,anchorX:i,root:s}){const r=e.useId(),a=e.useRef(null),l=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=e.useContext(fi);return e.useInsertionEffect(()=>{const{width:t,height:e,top:o,left:u,right:h}=l.current;if(n||!a.current||!t||!e)return;const d="left"===i?`left: ${u}`:`right: ${h}`;a.current.dataset.motionPopId=r;const p=document.createElement("style");c&&(p.nonce=c);const m=s??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${d}px !important;\n top: ${o}px !important;\n }\n `),()=>{m.contains(p)&&m.removeChild(p)}},[n]),u.jsx(yi,{isPresent:n,childRef:a,sizeRef:l,children:o.cloneElement(t,{ref:a})})}const vi=({children:t,initial:n,isPresent:i,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,root:h})=>{const p=d(xi),m=e.useId();let y=!0,g=e.useMemo(()=>(y=!1,{id:m,initial:n,isPresent:i,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>p.delete(t))}),[i,p,s]);return a&&y&&(g={...g}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[i]),o.useEffect(()=>{!i&&!p.size&&s&&s()},[i]),"popLayout"===l&&(t=u.jsx(gi,{isPresent:i,anchorX:c,root:h,children:t})),u.jsx(f.Provider,{value:g,children:t})};function xi(){return new Map}function bi(t=!0){const n=e.useContext(f);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const wi=t=>t.key||"";function Ti(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Si=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",root:c})=>{const[p,f]=bi(a),y=e.useMemo(()=>Ti(t),[t]),g=a&&!p?[]:y.map(wi),v=e.useRef(!0),x=e.useRef(y),b=d(()=>new Map),[w,T]=e.useState(y),[S,P]=e.useState(y);m(()=>{v.current=!1,x.current=y;for(let t=0;t<S.length;t++){const e=wi(S[t]);g.includes(e)?b.delete(e):!0!==b.get(e)&&b.set(e,!1)}},[S,g.length,g.join("-")]);const E=[];if(y!==w){let t=[...y];for(let e=0;e<S.length;e++){const n=S[e],i=wi(n);g.includes(i)||(t.splice(e,0,n),E.push(n))}return"wait"===r&&E.length&&(t=E),P(Ti(t)),T(y),null}"production"!==process.env.NODE_ENV&&"wait"===r&&S.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:A}=e.useContext(h);return u.jsx(u.Fragment,{children:S.map(t=>{const e=wi(t),h=!(a&&!p)&&(y===S||g.includes(e));return u.jsx(vi,{isPresent:h,initial:!(v.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,root:c,onExitComplete:h?void 0:()=>{if(!b.has(e))return;b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(A?.(),P(x.current),a&&f?.(),s&&s())},anchorX:l,children:t},e)})})},Pi=e.createContext({strict:!1}),Ei={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"]},Ai={};for(const t in Ei)Ai[t]={isEnabled:e=>Ei[t].some(t=>!!e[t])};const Ci=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 Mi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ci.has(t)}let ki=t=>!Mi(t);try{"function"==typeof(Vi=require("@emotion/is-prop-valid").default)&&(ki=t=>t.startsWith("on")?!Mi(t):Vi(t))}catch{}var Vi;const Di=e.createContext({});function Ri(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ji(t){return"string"==typeof t||Array.isArray(t)}const Li=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Oi=["initial",...Li];function Fi(t){return Ri(t.animate)||Oi.some(e=>ji(t[e]))}function Bi(t){return Boolean(Fi(t)||t.variants)}function Ii(t){const{initial:n,animate:i}=function(t,e){if(Fi(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ji(e)?e:void 0,animate:ji(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Di));return e.useMemo(()=>({initial:n,animate:i}),[Ni(n),Ni(i)])}function Ni(t){return Array.isArray(t)?t.join(" "):t}const Ui={};function $i(t,{layout:e,layoutId:n}){return Je.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ui[t]||"opacity"===t)}const Wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_i=Ze.length;function zi(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Je.has(t))r=!0;else if(ht(t))s[t]=n;else{const e=Hn(n,Wn[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<_i;o++){const r=Ze[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Hn(a,Wn[r]);l||(s=!1,i+=`${Wi[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Yi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xi(t,e,n){for(const i in e)pi(e[i])||$i(i,n)||(t[i]=e[i])}function Ki(t,n){const i={};return Xi(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return zi(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Hi(t,e){const n={},i=Ki(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const qi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gi={offset:"strokeDashoffset",array:"strokeDasharray"};function Zi(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(zi(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?qi:Gi;t[o.offset]=kt.transform(-i);const r=kt.transform(e),a=kt.transform(n);t[o.array]=`${r} ${a}`}(h,s,o,r,!1)}const Ji=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Qi=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ts(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Zi(e,n,Qi(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Xi(e,t.style,t),o.style={...e,...o.style}}return o}const es=["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 ns(t){return"string"==typeof t&&!t.includes("-")&&!!(es.indexOf(t)>-1||/[A-Z]/u.test(t))}function is(t,n,i,{latestValues:s},o,r=!1){const a=(ns(t)?ts:Hi)(n,s,o,t),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(ki(s)||!0===n&&Mi(s)||!e&&!Mi(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof t,r),c=t!==e.Fragment?{...l,...a,ref:i}:{},{children:u}=n,h=e.useMemo(()=>pi(u)?u.get():u,[u]);return e.createElement(t,{...c,children:h})}function ss(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function os(t,e,n,i){if("function"==typeof e){const[s,o]=ss(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=ss(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function rs(t){return pi(t)?t.get():t}function as(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=rs(o[t]);let{initial:r,animate:a}=t;const l=Fi(t),c=Bi(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Ri(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=os(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const ls=t=>(n,i)=>{const s=e.useContext(Di),o=e.useContext(f),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:as(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():d(r)};function cs(t,e,n){const{style:i}=t,s={};for(const o in i)(pi(i[o])||e.style&&pi(e.style[o])||$i(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}const us=ls({scrapeMotionValuesFromProps:cs,createRenderState:Yi});function hs(t,e,n){const i=cs(t,e,n);for(const n in t)if(pi(t[n])||pi(e[n])){i[-1!==Ze.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const ds=ls({scrapeMotionValuesFromProps:hs,createRenderState:Ji}),ps=Symbol.for("motionComponentSymbol");function ms(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function fs(t,n,i){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):ms(i)&&(i.current=e))},[n])}const ys=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),gs="data-"+ys("framerAppearId"),vs=e.createContext({});function xs(t,n,i,s,o){const{visualElement:r}=e.useContext(Di),a=e.useContext(Pi),l=e.useContext(f),c=e.useContext(fi).reducedMotion,u=e.useRef(null);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:n,parent:r,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c}));const h=u.current,d=e.useContext(vs);!h||h.projection||!o||"html"!==h.type&&"svg"!==h.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:bs(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&ms(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(u.current,i,o,d);const p=e.useRef(!1);e.useInsertionEffect(()=>{h&&p.current&&h.update(i,l)});const y=i[gs],g=e.useRef(Boolean(y)&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return m(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),g.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!g.current&&h.animationState&&h.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),g.current=!1),h.enteringChildren=void 0)}),h}function bs(t){if(t)return!1!==t.options.allowProjection?t.projection:bs(t.parent)}function ws(t,{forwardMotionProps:n=!1}={},i,s){i&&function(t){for(const e in t)Ai[e]={...Ai[e],...t[e]}}(i);const o=ns(t)?ds:us;function r(r,a){let l;const c={...e.useContext(fi),...r,layoutId:Ts(r)},{isStatic:h}=c,d=Ii(r),m=o(r,h);if(!h&&p){!function(t,n){const i=e.useContext(Pi).strict;if("production"!==process.env.NODE_ENV&&n&&i){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?b(!1,e,"lazy-strict-mode"):w(!1,e,"lazy-strict-mode")}}(c,i);const n=function(t){const{drag:e,layout:n}=Ai;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(c);l=n.MeasureLayout,d.visualElement=xs(t,m,c,s,n.ProjectionNode)}return u.jsxs(Di.Provider,{value:d,children:[l&&d.visualElement?u.jsx(l,{visualElement:d.visualElement,...c}):null,is(t,r,fs(m,d.visualElement,a),m,h,n)]})}r.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const a=e.forwardRef(r);return a[ps]=t,a}function Ts({layoutId:t}){const n=e.useContext(h).id;return n&&void 0!==t?n+"-"+t:t}function Ss(t,e){if("undefined"==typeof Proxy)return ws;const n=new Map,i=(n,i)=>ws(n,i,t,e);return new Proxy((t,e)=>("production"!==process.env.NODE_ENV&&F(!1,"motion() is deprecated. Use motion.create() instead."),i(t,e)),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,ws(o,void 0,t,e)),n.get(o))})}function Ps({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Es(t){return void 0===t||1===t}function As({scale:t,scaleX:e,scaleY:n}){return!Es(t)||!Es(e)||!Es(n)}function Cs(t){return As(t)||Ms(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ms(t){return ks(t.x)||ks(t.y)}function ks(t){return t&&"0%"!==t}function Vs(t,e,n){return n+e*(t-n)}function Ds(t,e,n,i,s){return void 0!==s&&(t=Vs(t,s,i)),Vs(t,n,i)+e}function Rs(t,e=0,n=1,i,s){t.min=Ds(t.min,e,n,i,s),t.max=Ds(t.max,e,n,i,s)}function js(t,{x:e,y:n}){Rs(t.x,e.translate,e.scale,e.originPoint),Rs(t.y,n.translate,n.scale,n.originPoint)}const Ls=.999999999999,Os=1.0000000000001;function Fs(t,e){t.min=t.min+e,t.max=t.max+e}function Bs(t,e,n,i,s=.5){Rs(t,e,n,Xt(t.min,t.max,s),i)}function Is(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 Ns(t,e){return Ps(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Us=()=>({x:{min:0,max:0},y:{min:0,max:0}}),$s={current:null},Ws={current:!1};const _s=new WeakMap;const zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=un,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 t=ct.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,it.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Fi(e),this.isVariantNode=Bi(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&pi(e)&&e.set(a[t])}}mount(t){this.current=t,_s.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ws.current||function(){if(Ws.current=!0,p)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>$s.current=t.matches;t.addEventListener("change",e),e()}else $s.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||$s.current),"production"!==process.env.NODE_ENV&&F(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),st(this.notifyUpdate),st(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Je.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&it.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ai){const e=Ai[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<zs.length;e++){const n=zs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(pi(s))t.addValue(i,s);else if(pi(o))t.addValue(i,Zn(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Zn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Zn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(S(n)||E(n))?n=parseFloat(n):(i=n,!mi.find(jn(i))&&_t.test(e)&&(n=Yn(t,e))),this.setBaseTarget(t,pi(n)?n.get():n)),pi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=os(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||pi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new D),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Jn.render(this.render)}}class Xs extends Ys{constructor(){super(...arguments),this.KeyframeResolver=Kn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Ks(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}class Hs extends Xs{constructor(){super(...arguments),this.type="html",this.renderInstance=Ks}readValueFromInstance(t,e){if(Je.has(e))return this.projection?.isProjecting?He(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return qe(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(ht(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ns(t,e)}build(t,e,n){zi(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return cs(t,e,n)}}const qs=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"]);class Gs extends Xs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Us}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Je.has(e)){const t=zn(e);return t&&t.default||0}return e=qs.has(e)?e:ys(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return hs(t,e,n)}build(t,e,n){Zi(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ks(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(qs.has(n)?n:ys(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Qi(t.tagName),super.mount(t)}}const Zs=(t,n)=>ns(t)?new Gs(n):new Hs(n,{allowProjection:t!==e.Fragment});function Js(t,e,n){const i=t.getProps();return os(i,e,void 0!==n?n:i.custom,t)}const Qs=t=>Array.isArray(t);function to(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Zn(n))}function eo(t){return Qs(t)?t[t.length-1]||0:t}function no(t,e){const n=t.getValue("willChange");if(i=n,Boolean(pi(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function io(t){return t.props[gs]}const so=t=>null!==t;const oo={type:"spring",stiffness:500,damping:25,restSpeed:10},ro={type:"keyframes",duration:.8},ao={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},lo=(t,{keyframes:e})=>e.length>2?ro:Je.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:oo:ao;const co=(t,e,n,i={},s,o)=>r=>{const a=Dn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=R(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,lo(t,u)),u.duration&&(u.duration=R(u.duration)),u.repeatDelay&&(u.repeatDelay=R(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(En(u),0===u.delay&&(h=!0)),(T.instantAnimations||T.skipAnimations)&&(h=!0,En(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(so),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}(u.keyframes,a);if(void 0!==t)return void it.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ue(u):new Mn(u)};function uo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function ho(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;i&&(o=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&uo(c,e))continue;const r={delay:n,...Dn(o||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!r.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=io(t);if(n){const t=window.MotionHandoffAnimation(n,e,it);null!==t&&(r.startTime=t,h=!0)}}no(t,e),i.start(co(e,i,s,t.shouldReduceMotion&&Rn.has(e)?{type:!1}:r,t,h));const d=i.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{it.update(()=>{r&&function(t,e){const n=Js(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)to(t,e,eo(o[e]))}(t,r)})}),l}function po(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}function mo(t,e,n={}){const i=Js(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ho(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(mo(l,e,{...r,delay:n+("function"==typeof i?0:i)+po(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function fo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const yo=Oi.length;function go(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&go(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<yo;n++){const i=Oi[n],s=t.props[i];(ji(s)||!1===s)&&(e[i]=s)}return e}const vo=[...Li].reverse(),xo=Li.length;function bo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>mo(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=mo(t,e,n);else{const s="function"==typeof e?Js(t,e,n.custom):e;i=Promise.all(ho(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function wo(t){let e=bo(t),n=Po(),i=!0;const s=e=>(n,i)=>{const s=Js(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=go(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<xo;e++){const d=vo[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=ji(m),y=d===o?p.isActive:null;!1===y&&(h=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&i&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...u},!p.isActive&&null===y||!m&&!p.prevProp||Ri(m)||"boolean"==typeof m)continue;const v=To(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>h&&f,b=!1;const w=Array.isArray(m)?m:[m];let T=w.reduce(s(d),{});!1===y&&(T={});const{prevResolvedValues:S={}}=p,P={...S,...T},E=e=>{x=!0,c.has(e)&&(b=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in P){const e=T[t],n=S[t];if(u.hasOwnProperty(t))continue;let i=!1;i=Qs(e)&&Qs(n)?!fo(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=T,p.isActive&&(u={...u,...T}),i&&t.blockInitialAnimation&&(x=!1);const A=g&&v;x&&(!A||b)&&l.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Js(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=po(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=Js(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Po(),i=!0}}}function To(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fo(e,t)}function So(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Po(){return{animate:So(!0),whileInView:So(),whileHover:So(),whileTap:So(),whileDrag:So(),whileFocus:So(),exit:So()}}class Eo{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ao=0;const Co={animation:{Feature:class extends Eo{constructor(t){super(t),t.animationState||(t.animationState=wo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ri(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends Eo{constructor(){super(...arguments),this.id=Ao++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Mo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function ko(t){return{point:{x:t.pageX,y:t.pageY}}}function Vo(t,e,n,i){return Mo(t,e,(t=>e=>oi(e)&&t(e,ko(e)))(n),i)}function Do(t){return t.max-t.min}function Ro(t,e,n,i=.5){t.origin=i,t.originPoint=Xt(e.min,e.max,t.origin),t.scale=Do(n)/Do(e),t.translate=Xt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function jo(t,e,n,i){Ro(t.x,e.x,n.x,i?i.originX:void 0),Ro(t.y,e.y,n.y,i?i.originY:void 0)}function Lo(t,e,n){t.min=n.min+e.min,t.max=t.min+Do(e)}function Oo(t,e,n){t.min=e.min-n.min,t.max=t.min+Do(e)}function Fo(t,e,n){Oo(t.x,e.x,n.x),Oo(t.y,e.y,n.y)}function Bo(t){return[t("x"),t("y")]}const Io=({current:t})=>t?t.ownerDocument.defaultView:null,No=(t,e)=>Math.abs(t-e);class Uo{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=_o(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=No(t.x,e.x),i=No(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=ot;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=$o(e,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=_o("pointercancel"===t.type?this.lastMoveEventInfo:$o(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!oi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const r=$o(ko(t),this.transformPagePoint),{point:a}=r,{timestamp:l}=ot;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=e;c&&c(t,_o(r,this.history)),this.removeListeners=k(Vo(this.contextWindow,"pointermove",this.handlePointerMove),Vo(this.contextWindow,"pointerup",this.handlePointerUp),Vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),st(this.updatePoint)}}function $o(t,e){return e?{point:e(t.point)}:t}function Wo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function _o({point:t},e){return{point:t,delta:Wo(t,Yo(e)),offset:Wo(t,zo(e)),velocity:Xo(e,.1)}}function zo(t){return t[0]}function Yo(t){return t[t.length-1]}function Xo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Yo(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>R(e)));)n--;if(!i)return{x:0,y:0};const o=j(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Ko(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Ho(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const qo=.35;function Go(t,e,n){return{min:Zo(t,e),max:Zo(t,n)}}function Zo(t,e){return"number"==typeof t?t:t[e]||0}const Jo=new WeakMap;class Qo{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new Uo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(ko(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?ti[o]?null:(ti[o]=!0,()=>{ti[o]=!1}):ti.x||ti.y?null:(ti.x=ti.y=!0,()=>{ti.x=ti.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bo(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Mt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Do(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&it.postRender(()=>s(t,e)),no(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>Bo(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:Io(this.visualElement)})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&it.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!tr(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Xt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Xt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&ms(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Ko(t.x,n,s),y:Ko(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=qo){return!1===t?t=0:!0===t&&(t=qo),{x:Go(t,"left","right"),y:Go(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Bo(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!ms(t))return!1;const n=t.current;w(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Ns(t,n),{scroll:s}=e;return s&&(Fs(i.x,s.offset.x),Fs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ho(t.x,e.x),y:Ho(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Ps(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Bo(r=>{if(!tr(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return no(this.visualElement,t),n.start(co(t,n,0,e,this.visualElement,!1))}stopAnimation(){Bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bo(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Bo(e=>{const{drag:n}=this.getProps();if(!tr(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-Xt(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!ms(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bo(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Do(t),s=Do(e);return s>i?n=V(e.min,e.max-i,t.min):i>s&&(n=V(t.min,t.max-s,e.min)),v(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Bo(e=>{if(!tr(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Xt(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;Jo.set(this.visualElement,this);const t=Vo(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();ms(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),it.read(e);const s=Mo(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bo(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=qo,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function tr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const er=t=>(e,n)=>{t&&it.postRender(()=>t(e,n))};const nr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ir(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const sr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!kt.test(t))return t;t=parseFloat(t)}return`${ir(t,e.target.x)}% ${ir(t,e.target.y)}%`}},or={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=_t.parse(t);if(s.length>5)return i;const o=_t.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Xt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};let rr=!1;class ar extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Ui[e]=t[e],ht(e)&&(Ui[e].isCSSVariable=!0)}(cr),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),rr&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),nr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,rr=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||it.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Jn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;rr=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function lr(t){const[n,i]=bi(),s=e.useContext(h);return u.jsx(ar,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(vs),isPresent:n,safeToRemove:i})}const cr={borderRadius:{...sr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sr,borderTopRightRadius:sr,borderBottomLeftRadius:sr,borderBottomRightRadius:sr,boxShadow:or};const ur=(t,e)=>t.depth-e.depth;class hr{constructor(){this.children=[],this.isDirty=!1}add(t){y(this.children,t),this.isDirty=!0}remove(t){g(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ur),this.isDirty=!1,this.children.forEach(t)}}const dr=["TopLeft","TopRight","BottomLeft","BottomRight"],pr=dr.length,mr=t=>"string"==typeof t?parseFloat(t):t,fr=t=>"number"==typeof t||kt.test(t);function yr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const gr=xr(0,.5,X),vr=xr(.5,.95,C);function xr(t,e,n){return i=>i<t?0:i>e?1:n(V(t,e,i))}function br(t,e){t.min=e.min,t.max=e.max}function wr(t,e){br(t.x,e.x),br(t.y,e.y)}function Tr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Sr(t,e,n,i,s){return t=Vs(t-=e,1/n,i),void 0!==s&&(t=Vs(t,1/s,i)),t}function Pr(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Mt.test(e)&&(e=parseFloat(e),e=Xt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Xt(o.min,o.max,i);t===o&&(a-=e),t.min=Sr(t.min,e,n,a,s),t.max=Sr(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Er=["x","scaleX","originX"],Ar=["y","scaleY","originY"];function Cr(t,e,n,i){Pr(t.x,e,Er,n?n.x:void 0,i?i.x:void 0),Pr(t.y,e,Ar,n?n.y:void 0,i?i.y:void 0)}function Mr(t){return 0===t.translate&&1===t.scale}function kr(t){return Mr(t.x)&&Mr(t.y)}function Vr(t,e){return t.min===e.min&&t.max===e.max}function Dr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Rr(t,e){return Dr(t.x,e.x)&&Dr(t.y,e.y)}function jr(t){return Do(t.x)/Do(t.y)}function Lr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Or{constructor(){this.members=[]}add(t){y(this.members,t),t.scheduleRender()}remove(t){if(g(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Fr=["","X","Y","Z"];let Br=0;function Ir(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Nr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=io(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Nr(i)}function Ur({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Br++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(_r),this.nodes.forEach(Gr),this.nodes.forEach(Zr),this.nodes.forEach(zr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new hr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new D),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=di(e)&&!(di(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;it.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=ct.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(st(i),t(o-e))};return it.setup(i,!0),()=>st(i)}(s,250),nr.hasAnimatedSinceResize&&(nr.hasAnimatedSinceResize=!1,this.nodes.forEach(qr)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||ia,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Rr(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Dn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||qr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),st(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(Jr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Nr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Xr);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Kr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hr),this.nodes.forEach($r),this.nodes.forEach(Wr)):this.nodes.forEach(Kr),this.clearAllSnapshots();const t=ct.now();ot.delta=v(0,1e3/60,t-ot.timestamp),ot.timestamp=t,ot.isProcessing=!0,rt.update.process(ot),rt.preRender.process(ot),rt.render.process(ot),ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Jn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yr),this.sharedNodes.forEach(Qr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Do(this.snapshot.measuredBox.x)||Do(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!kr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Cs(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),ra((i=n).x),ra(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(la))){const{scroll:t}=this.root;t&&(Fs(e.x,t.offset.x),Fs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(wr(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&wr(e,t),Fs(e.x,s.offset.x),Fs(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};wr(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Is(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Cs(i.latestValues)&&Is(n,i.latestValues)}return Cs(this.latestValues)&&Is(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};wr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Cs(n.latestValues))continue;As(n.latestValues)&&n.updateSnapshot();const i=Us();wr(i,n.measurePageBox()),Cr(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Cs(this.latestValues)&&Cr(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ot.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(this.layout&&(i||s)){if(this.resolvedRelativeTargetAt=ot.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Fo(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),wr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,r,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),o=this.target,r=this.relativeTarget,a=this.relativeParent.target,Lo(o.x,r.x,a.x),Lo(o.y,r.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):wr(this.target,this.layout.layoutBox),js(this.target,this.targetDelta)):wr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Fo(this.relativeTargetOrigin,this.target,t.target),wr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!As(this.parent.latestValues)&&!Ms(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===ot.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;wr(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Is(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,js(t,r)),i&&Cs(o.latestValues)&&Is(t,o.latestValues))}e.x<Os&&e.x>Ls&&(e.x=1),e.y<Os&&e.y>Ls&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Tr(this.prevProjectionDelta.x,this.projectionDelta.x),Tr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),jo(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Lr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Lr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(na));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,y;ta(o.x,t.x,n),ta(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,y=n,ea(p.x,m.x,f.x,y),ea(p.y,m.y,f.y,y),h&&(l=this.relativeTarget,d=h,Vr(l.x,d.x)&&Vr(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),wr(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Xt(0,n.opacity??1,gr(i)),t.opacityExit=Xt(e.opacity??1,0,vr(i))):o&&(t.opacity=Xt(e.opacity??1,n.opacity??1,i));for(let s=0;s<pr;s++){const o=`border${dr[s]}Radius`;let r=yr(e,o),a=yr(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||fr(r)===fr(a)?(t[o]=Math.max(Xt(mr(r),mr(a),i),0),(Mt.test(a)||Mt.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=Xt(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(st(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{nr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zn(0)),this.currentAnimation=function(t,e,n){const i=pi(t)?t:Zn(t);return i.start(co("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&aa(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Do(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Do(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}wr(e,n),Is(e,s),jo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Or);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ir("z",t,i,this.animationValues);for(let e=0;e<Fr.length;e++)Ir(`rotate${Fr[e]}`,t,i,this.animationValues),Ir(`skew${Fr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=rs(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=rs(e?.pointerEvents)||""),void(this.hasProjected&&!Cs(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Ui){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Ui[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?rs(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Xr),this.root.sharedNodes.clear()}}}function $r(t){t.updateLayout()}function Wr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Bo(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Do(i);i.min=n[t].min,i.max=i.min+s}):aa(s,e.layoutBox,n)&&Bo(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Do(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jo(a,t.applyTransform(i,!0),e.measuredBox):jo(a,n,e.layoutBox);const l=!kr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Fo(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Fo(a,n,o.layoutBox),Rr(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function _r(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Yr(t){t.clearSnapshot()}function Xr(t){t.clearMeasurements()}function Kr(t){t.isLayoutDirty=!1}function Hr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function qr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Gr(t){t.resolveTargetDelta()}function Zr(t){t.calcProjection()}function Jr(t){t.resetSkewAndRotation()}function Qr(t){t.removeLeadSnapshot()}function ta(t,e,n){t.translate=Xt(e.translate,0,n),t.scale=Xt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ea(t,e,n,i){t.min=Xt(e.min,n.min,i),t.max=Xt(e.max,n.max,i)}function na(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ia={duration:.45,ease:[.4,0,.1,1]},sa=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),oa=sa("applewebkit/")&&!sa("chrome/")?Math.round:C;function ra(t){t.min=oa(t.min),t.max=oa(t.max)}function aa(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=jr(e),s=jr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function la(t){return t!==t.root&&t.scroll?.wasRoot}const ca=Ur({attachResizeListener:(t,e)=>Mo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ua={current:void 0},ha=Ur({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ua.current){const t=new ca({});t.mount(window),t.setOptions({layoutScroll:!0}),ua.current=t}return ua.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),da={pan:{Feature:class extends Eo{constructor(){super(...arguments),this.removePointerDownListener=C}onPointerDown(t){this.session=new Uo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Io(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:er(t),onStart:er(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&it.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Vo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Eo{constructor(t){super(t),this.removeGroupControls=C,this.removeListeners=C,this.controls=new Qo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ha,MeasureLayout:lr}};function pa(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&it.postRender(()=>s(e,ko(e)))}function ma(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&it.postRender(()=>s(e,ko(e)))}const fa=new WeakMap,ya=new WeakMap,ga=t=>{const e=fa.get(t.target);e&&e(t)},va=t=>{t.forEach(ga)};function xa(t,e,n){const i=function({root:t,...e}){const n=t||document;ya.has(n)||ya.set(n,{});const i=ya.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(va,{root:t,...e})),i[s]}(e);return fa.set(t,n),i.observe(t),()=>{fa.delete(t),i.unobserve(t)}}const ba={some:0,all:1};const wa={inView:{Feature:class extends Eo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:ba[i]};return xa(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Eo{mount(){const{current:t}=this.node;t&&(this.unmount=hi(t,(t,e)=>(ma(this.node,e,"Start"),(t,{success:e})=>ma(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Eo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&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=k(Mo(this.node.current,"focus",()=>this.onFocus()),Mo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Eo{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=ni(t,n),r=t=>{if(!ii(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{ii(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(pa(this.node,e,"Start"),t=>pa(this.node,t,"End"))))}unmount(){}}}},Ta=Ss({...Co,...wa,...da,...{layout:{ProjectionNode:ha,MeasureLayout:lr}}},Zs);function Sa(t){const{open:e,width:i="40vw",title:s="",showIcon:o=!0,showClose:r=!0,onCancel:a,children:l,icon:c,style:h}=t,d="number"==typeof i?`${Math.min(i,100)}vw`:i,p={x:"-50%",y:"-50%"};return n.createPortal(u.jsx(Si,{children:e&&u.jsxs(Ta.div,{className:"dialog-custom",style:{width:d,position:"fixed",top:"50%",left:"50%",zIndex:2007,...h},initial:{opacity:0,scale:.3,...p},animate:{opacity:1,scale:1,...p},exit:{opacity:0,scale:.3,...p},transition:{duration:.3},children:[(s||o||r)&&u.jsxs("div",{className:"dialog-custom-title",children:[u.jsxs("div",{className:"left",children:[o&&u.jsx("div",{className:"dialog-title-icon",children:c||"📣"}),u.jsx("span",{children:s})]}),u.jsx("div",{className:"right",children:r&&u.jsx("div",{className:"dialog-close-icon",onClick:a,role:"button","aria-label":"关闭弹窗",children:"✕"})})]}),u.jsx("div",{className:"dialog-custom-content",children:l})]})}),document.body)}let Pa=new Map;const Ea=new Set;function Aa(){return Pa}function Ca(t){return Ea.add(t),()=>Ea.delete(t)}function Ma(){Ea.forEach(t=>t())}const ka="default";class Va{static lockScroll(){if(this.openCount++,1===this.openCount){this.originalStyles={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight};const t=function(){const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);const e=document.createElement("div");t.appendChild(e);const n=t.offsetWidth-e.offsetWidth;return document.body.removeChild(t),n}();document.body.style.overflow="hidden",document.body.style.paddingRight=`${t}px`}}static unlockScroll(){this.openCount=Math.max(0,this.openCount-1),0===this.openCount&&this.originalStyles&&(document.body.style.overflow=this.originalStyles.overflow,document.body.style.paddingRight=this.originalStyles.paddingRight,this.originalStyles=null)}}function Da(t){const e=Pa,n=e.get(t);if(n)return n;const i={visible:!1,options:null,resolve:void 0,reject:void 0},s=new Map(e);return s.set(t,i),Pa=s,Ma(),i}function Ra(t,e){const n=Pa,i=n.get(t);if(i){const s=new Map(n);s.set(t,{...i,...e}),Pa=s,Ma()}}function ja(t){const e=t.familyName||ka;return new Promise((n,i)=>{Da(e),Va.lockScroll();const s=(t,s=!1)=>{Ra(e,{visible:!1}),setTimeout(()=>{Va.unlockScroll(),Ra(e,{options:null,resolve:void 0,reject:void 0}),s?i(new Error("弹窗被取消")):n(t)},300)};Ra(e,{visible:!0,options:{...t,familyName:e},resolve:t=>s(t,!1),reject:()=>s(null,!0)})})}Va.originalStyles=null,Va.openCount=0;const La={open:(t,e)=>ja({component:t,...e}),openWithFamily:(t,e,n)=>ja({component:e,familyName:t,...n}),close:(t=ka)=>{const e=Da(t);e.visible&&e.reject?.()},closeAll:()=>{Pa.forEach(t=>{t.visible&&t.reject?.()})},getStates:()=>Pa,hasOpenDialog:t=>{const e=Pa;if(t){const n=e.get(t);return n?.visible??!1}return Array.from(e.values()).some(t=>t.visible)}};function Oa(t){return e.useSyncExternalStore(Ca,()=>t(Aa()),()=>t(Aa()))}const Fa=ja;t.DialogCustom=Sa,t.DialogCustomProvider=function(){const t=e.useSyncExternalStore(Ca,Aa,Aa),i=Array.from(t.values()).some(t=>t.visible),s=Array.from(t.entries()).filter(([t,e])=>e.visible&&e.options),o=s.length>0?s[s.length-1]:void 0,r=o?.[1].options?.maskBg;return u.jsxs(u.Fragment,{children:[n.createPortal(u.jsx(Si,{children:i&&u.jsx(Ta.div,{className:"global-dialog-mask",onClick:()=>{for(let t=s.length-1;t>=0;t--){const[e,n]=s[t],{maskClosable:i=!0}=n.options;if(i){n.reject?.();break}}},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:r??"rgba(0, 0, 0, 0.4)",zIndex:2006,display:"flex",alignItems:"center",justifyContent:"center"}})}),document.body),Array.from(t.entries()).map(([t,e])=>{if(!e.options)return null;const{component:n,...i}=e.options;return u.jsx(Sa,{open:e.visible,title:i.title,width:i.width,showIcon:i.showIcon,showClose:i.showClose,onCancel:e.reject,icon:i.icon,style:i.style,children:u.jsx(n,{...i.props||{},onClose:e.resolve,onNext:i.onNext||i.props?.onNext})},t)})]})},t.DialogCustomStaticMethods=La,t.default=Fa,t.getDialogFrozenSnapshot=function(){return Pa},t.openDialogCustom=ja,t.subscribeHasOpen=function(t){const e=()=>Array.from(Pa.values()).some(t=>t.visible);let n=e();t(n);const i=Ca(()=>{const i=e();i!==n&&(n=i,t(i))});return()=>i()},t.useDialogCustom=Fa,t.useDialogSelector=Oa,t.useFamilyVisible=function(t){return Oa(e=>!0===e.get(t)?.visible)},t.useHasOpenDialog=function(){return Oa(t=>Array.from(t.values()).some(t=>t.visible))},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.umd.js.map