framer-motion 12.4.13 → 12.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/client.js +1 -1
  3. package/dist/cjs/{create-DkTZDHiS.js → create-CgwP8YNL.js} +4234 -4792
  4. package/dist/cjs/debug.js +5 -281
  5. package/dist/cjs/dom-mini.js +9 -7
  6. package/dist/cjs/dom.js +81 -639
  7. package/dist/cjs/index.js +1555 -1553
  8. package/dist/cjs/m.js +11 -179
  9. package/dist/cjs/mini.js +8 -0
  10. package/dist/debug.d.ts +2 -35
  11. package/dist/dom-mini.d.ts +1 -181
  12. package/dist/dom-mini.js +1 -1
  13. package/dist/dom.d.ts +3 -242
  14. package/dist/dom.js +1 -1
  15. package/dist/es/animation/animate/single-value.mjs +1 -1
  16. package/dist/es/animation/animators/BaseAnimation.mjs +1 -1
  17. package/dist/es/animation/animators/MainThreadAnimation.mjs +1 -2
  18. package/dist/es/animation/animators/drivers/driver-frameloop.mjs +1 -2
  19. package/dist/es/animation/animators/waapi/index.mjs +1 -3
  20. package/dist/es/animation/generators/utils/velocity.mjs +1 -1
  21. package/dist/es/animation/interfaces/motion-value.mjs +2 -4
  22. package/dist/es/animation/interfaces/visual-element-target.mjs +1 -2
  23. package/dist/es/animation/optimized-appear/start.mjs +3 -3
  24. package/dist/es/animation/sequence/utils/edit.mjs +1 -1
  25. package/dist/es/components/AnimatePresence/index.mjs +1 -1
  26. package/dist/es/components/Reorder/utils/check-reorder.mjs +1 -1
  27. package/dist/es/debug.mjs +1 -1
  28. package/dist/es/dom.mjs +1 -5
  29. package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -2
  30. package/dist/es/gestures/hover.mjs +1 -2
  31. package/dist/es/gestures/pan/PanSession.mjs +1 -2
  32. package/dist/es/gestures/pan/index.mjs +1 -1
  33. package/dist/es/gestures/press.mjs +1 -2
  34. package/dist/es/index.mjs +14 -19
  35. package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -2
  36. package/dist/es/motion/utils/use-visual-element.mjs +6 -6
  37. package/dist/es/projection/node/create-projection-node.mjs +2 -8
  38. package/dist/es/projection/shared/stack.mjs +1 -1
  39. package/dist/es/projection.mjs +1 -3
  40. package/dist/es/render/VisualElement.mjs +2 -5
  41. package/dist/es/render/components/create-proxy.mjs +1 -1
  42. package/dist/es/render/dom/DOMVisualElement.mjs +1 -1
  43. package/dist/es/render/dom/scroll/info.mjs +1 -2
  44. package/dist/es/render/dom/scroll/observe.mjs +1 -1
  45. package/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -1
  46. package/dist/es/render/dom/scroll/track.mjs +1 -1
  47. package/dist/es/render/svg/SVGVisualElement.mjs +1 -1
  48. package/dist/es/render/svg/config-motion.mjs +1 -1
  49. package/dist/es/render/utils/KeyframesResolver.mjs +1 -1
  50. package/dist/es/render/utils/flat-tree.mjs +1 -1
  51. package/dist/es/render/utils/motion-values.mjs +3 -3
  52. package/dist/es/render/utils/setters.mjs +1 -1
  53. package/dist/es/utils/delay.mjs +1 -2
  54. package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -1
  55. package/dist/es/utils/use-animation-frame.mjs +1 -1
  56. package/dist/es/utils/use-force-update.mjs +1 -1
  57. package/dist/es/utils/use-instant-transition.mjs +1 -1
  58. package/dist/es/value/scroll/use-element-scroll.mjs +1 -1
  59. package/dist/es/value/scroll/use-viewport-scroll.mjs +1 -1
  60. package/dist/es/value/use-combine-values.mjs +2 -2
  61. package/dist/es/value/use-computed.mjs +1 -1
  62. package/dist/es/value/use-inverted-scale.mjs +3 -3
  63. package/dist/es/value/use-motion-value.mjs +1 -1
  64. package/dist/es/value/use-scroll.mjs +4 -4
  65. package/dist/es/value/use-spring.mjs +1 -1
  66. package/dist/es/value/use-transform.mjs +1 -1
  67. package/dist/es/value/use-velocity.mjs +1 -1
  68. package/dist/es/value/use-will-change/WillChangeMotionValue.mjs +2 -2
  69. package/dist/framer-motion.dev.js +8227 -8251
  70. package/dist/framer-motion.js +1 -1
  71. package/dist/m.d.ts +49 -241
  72. package/dist/size-rollup-animate.js +1 -1
  73. package/dist/size-rollup-dom-animation-assets.js +1 -1
  74. package/dist/size-rollup-dom-animation.js +1 -1
  75. package/dist/size-rollup-dom-max-assets.js +1 -1
  76. package/dist/size-rollup-dom-max.js +1 -1
  77. package/dist/size-rollup-m.js +1 -1
  78. package/dist/size-rollup-motion.js +1 -1
  79. package/dist/size-rollup-scroll.js +1 -1
  80. package/dist/types/client.d.ts +2 -2
  81. package/dist/types/index.d.ts +43 -79
  82. package/dist/{types.d-6pKw1mTI.d.ts → types.d-B50aGbjN.d.ts} +81 -289
  83. package/package.json +4 -6
  84. package/dist/es/frameloop/batcher.mjs +0 -69
  85. package/dist/es/frameloop/frame.mjs +0 -6
  86. package/dist/es/frameloop/index-legacy.mjs +0 -20
  87. package/dist/es/frameloop/microtask.mjs +0 -5
  88. package/dist/es/frameloop/order.mjs +0 -10
  89. package/dist/es/frameloop/render-step.mjs +0 -92
  90. package/dist/es/frameloop/sync-time.mjs +0 -31
  91. package/dist/es/stats/animation-count.mjs +0 -7
  92. package/dist/es/stats/buffer.mjs +0 -6
  93. package/dist/es/stats/index.mjs +0 -113
  94. package/dist/es/utils/GlobalConfig.mjs +0 -6
  95. package/dist/es/utils/array.mjs +0 -21
  96. package/dist/es/utils/subscription-manager.mjs +0 -40
  97. package/dist/es/utils/velocity-per-second.mjs +0 -11
  98. package/dist/es/utils/warn-once.mjs +0 -11
  99. package/dist/es/value/index.mjs +0 -319
  100. package/dist/three.d.ts +0 -2833
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useId as s,useEffect as o,useCallback as r,Component as a,useMemo as l,useLayoutEffect as u,useRef as h,useInsertionEffect as c,forwardRef as d,Fragment as p,createElement as m}from"react";function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=v(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]=v(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function y(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}const x=t=>t;let P=x;function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const w=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},S=t=>1e3*t,b=t=>t/1e3,A=T(()=>void 0!==window.ScrollTimeline);class E extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>A()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function V(t,e){return t?t[e]||t.default||t:void 0}function M(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function D(t){return"function"==typeof t}function C(t,e){t.timeline=e,t.onfinish=null}const k=t=>Array.isArray(t)&&"number"==typeof t[0],R={linearEasing:void 0};function L(t,e){const n=T(t);return()=>{var t;return null!==(t=R[e])&&void 0!==t?t:n()}}const B=L(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),j=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(w(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function F(t){return Boolean("function"==typeof t&&B()||!t||"string"==typeof t&&(t in I||B())||k(t)||Array.isArray(t)&&t.every(F))}const O=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,I={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:O([0,.65,.55,1]),circOut:O([.55,0,1,.45]),backIn:O([.31,.01,.66,-.59]),backOut:O([.33,1.53,.69,.99])};const U={x:!1,y:!1};function N(){return U.x||U.y}function W(t,e){const n=function(t,e,n){var i;if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const o=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:s.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Y(t){return!("touch"===t.pointerType||N())}function $(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const X=(t,e)=>!!e&&(t===e||X(t,e.parentElement)),K=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,z=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const H=new WeakSet;function G(t){return e=>{"Enter"===e.key&&t(e)}}function q(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Z(t){return K(t)&&!N()}function _(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{const n=t.currentTarget;if(!n||!Z(t)||H.has(n))return;H.add(n),$(t,"set");const i=e(n,t),o=(t,e)=>{n.removeEventListener("pointerup",r),n.removeEventListener("pointercancel",a),$(t,"release"),Z(t)&&H.has(n)&&(H.delete(n),"function"==typeof i&&i(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(i=t,s=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},i.clientX<s.left||i.clientX>s.right||i.clientY<s.top||i.clientY>s.bottom);var i,s;o(t,!e&&(!(n instanceof Element)||X(n,t.target)))},a=t=>{o(t,!1)};n.addEventListener("pointerup",r,s),n.addEventListener("pointercancel",a,s),n.addEventListener("lostpointercapture",a,s)};return i.forEach(t=>{let e=!1;var i;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,i=t,z.has(i.tagName)||-1!==i.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,s),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=G(()=>{if(H.has(n))return;q(n,"down");const t=G(()=>{q(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>q(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}const J=!1,Q=["read","resolveKeyframes","update","preRender","render","postRender"],tt={value:null,addProjectionMetrics:null};function et(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Q.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 u(e){r.has(e)&&(h.schedule(e),t()),l++,e(a)}const h={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(u),e&&tt.value&&tt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,h.process(t)))}};return h}(o,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:d}=r,p=()=>{const o=performance.now();n=!1,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),u.process(s),h.process(s),c.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:Q.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Q.length;e++)r[Q[e]].cancel(t)},state:s,steps:r}}const{schedule:nt,cancel:it,state:st,steps:ot}=et("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:x,!0),rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],at=new Set(rt),lt=new Set(["width","height","top","left","right","bottom",...rt]),ut=t=>Array.isArray(t);let ht;function ct(){ht=void 0}const dt={now:()=>(void 0===ht&&dt.set(st.isProcessing||J?st.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(ct)}};function pt(t,e){-1===t.indexOf(e)&&t.push(e)}function mt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ft{constructor(){this.subscriptions=[]}add(t){return pt(this.subscriptions,t),()=>mt(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}}function vt(t,e){return e?t*(1e3/e):0}class gt{constructor(t,e={}){this.version="12.4.13",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=dt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ft);const n=this.events[t].add(e);return"change"===t?()=>{n(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return vt(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new gt(t,e)}function xt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}const Pt=t=>Boolean(t&&t.getVelocity);function Tt(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Pt(i)&&i.add))return n.add(e);var i}const wt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),St="data-"+wt("framerAppearId");function bt(t){return t.props[St]}const At=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Et(t,e,n,i){if(t===e&&n===i)return x;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=At(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:At(s(t),e,i)}const Vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Mt=t=>e=>1-t(1-e),Dt=Et(.33,1.53,.69,.99),Ct=Mt(Dt),kt=Vt(Ct),Rt=t=>(t*=2)<1?.5*Ct(t):.5*(2-Math.pow(2,-10*(t-1))),Lt=t=>1-Math.sin(Math.acos(t)),Bt=Mt(Lt),jt=Vt(Lt),Ft=t=>/^0[^.\s]+$/u.test(t);const Ot=(t,e,n)=>n>e?e:n<t?t:n,It={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Ut={...It,transform:t=>Ot(0,1,t)},Nt={...It,default:1},Wt=t=>Math.round(1e5*t)/1e5,Yt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const $t=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xt=(t,e)=>n=>Boolean("string"==typeof n&&$t.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Kt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Yt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},zt={...It,transform:t=>Math.round((t=>Ot(0,255,t))(t))},Ht={test:Xt("rgb","red"),parse:Kt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+zt.transform(t)+", "+zt.transform(e)+", "+zt.transform(n)+", "+Wt(Ut.transform(i))+")"};const Gt={test:Xt("#"),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:Ht.transform},qt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Zt=qt("deg"),_t=qt("%"),Jt=qt("px"),Qt=qt("vh"),te=qt("vw"),ee={..._t,parse:t=>_t.parse(t)/100,transform:t=>_t.transform(100*t)},ne={test:Xt("hsl","hue"),parse:Kt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+_t.transform(Wt(e))+", "+_t.transform(Wt(n))+", "+Wt(Ut.transform(i))+")"},ie={test:t=>Ht.test(t)||Gt.test(t)||ne.test(t),parse:t=>Ht.test(t)?Ht.parse(t):ne.test(t)?ne.parse(t):Gt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ht.transform(t):ne.transform(t)},se=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const oe=/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 re(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(oe,t=>(ie.test(t)?(i.color.push(o),s.push("color"),n.push(ie.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function ae(t){return re(t).values}function le(t){const{split:e,types:n}=re(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+="number"===e?Wt(t[o]):"color"===e?ie.transform(t[o]):t[o]}return s}}const ue=t=>"number"==typeof t?0:t;const he={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Yt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(se))||void 0===n?void 0:n.length)||0)>0},parse:ae,createTransformer:le,getAnimatableNone:function(t){const e=ae(t);return le(t)(e.map(ue))}},ce=new Set(["brightness","contrast","saturate","opacity"]);function de(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Yt)||[];if(!i)return t;const s=n.replace(i,"");let o=ce.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const pe=/\b([a-z-]*)\(.*?\)/gu,me={...he,getAnimatableNone:t=>{const e=t.match(pe);return e?e.map(de).join(" "):t}},fe={borderWidth:Jt,borderTopWidth:Jt,borderRightWidth:Jt,borderBottomWidth:Jt,borderLeftWidth:Jt,borderRadius:Jt,radius:Jt,borderTopLeftRadius:Jt,borderTopRightRadius:Jt,borderBottomRightRadius:Jt,borderBottomLeftRadius:Jt,width:Jt,maxWidth:Jt,height:Jt,maxHeight:Jt,top:Jt,right:Jt,bottom:Jt,left:Jt,padding:Jt,paddingTop:Jt,paddingRight:Jt,paddingBottom:Jt,paddingLeft:Jt,margin:Jt,marginTop:Jt,marginRight:Jt,marginBottom:Jt,marginLeft:Jt,backgroundPositionX:Jt,backgroundPositionY:Jt},ve={rotate:Zt,rotateX:Zt,rotateY:Zt,rotateZ:Zt,scale:Nt,scaleX:Nt,scaleY:Nt,scaleZ:Nt,skew:Zt,skewX:Zt,skewY:Zt,distance:Jt,translateX:Jt,translateY:Jt,translateZ:Jt,x:Jt,y:Jt,z:Jt,perspective:Jt,transformPerspective:Jt,opacity:Ut,originX:ee,originY:ee,originZ:Jt},ge={...It,transform:Math.round},ye={...fe,...ve,zIndex:ge,size:Jt,fillOpacity:Ut,strokeOpacity:Ut,numOctaves:ge},xe={...ye,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:me,WebkitFilter:me},Pe=t=>xe[t];function Te(t,e){let n=Pe(t);return n!==me&&(n=he),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const we=new Set(["auto","none","0"]);const Se=t=>180*t/Math.PI,be=t=>{const e=Se(Math.atan2(t[1],t[0]));return Ee(e)},Ae={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:be,rotateZ:be,skewX:t=>Se(Math.atan(t[1])),skewY:t=>Se(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ee=t=>((t%=360)<0&&(t+=360),t),Ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Me=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),De={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ve,scaleY:Me,scale:t=>(Ve(t)+Me(t))/2,rotateX:t=>Ee(Se(Math.atan2(t[6],t[5]))),rotateY:t=>Ee(Se(Math.atan2(-t[2],t[0]))),rotateZ:be,rotate:be,skewX:t=>Se(Math.atan(t[4])),skewY:t=>Se(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ce(t){return t.includes("scale")?1:0}function ke(t,e){if(!t||"none"===t)return Ce(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=De,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Ae,s=e}if(!s)return Ce(e);const o=i[e],r=s[1].split(",").map(Re);return"function"==typeof o?o(r):r[o]}function Re(t){return parseFloat(t.trim())}const Le=t=>t===It||t===Jt,Be=new Set(["x","y","z"]),je=rt.filter(t=>!Be.has(t));const Fe={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})=>ke(e,"x"),y:(t,{transform:e})=>ke(e,"y")};Fe.translateX=Fe.x,Fe.translateY=Fe.y;const Oe=new Set;let Ie=!1,Ue=!1;function Ne(){if(Ue){const t=Array.from(Oe).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 je.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])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ue=!1,Ie=!1,Oe.forEach(t=>t.complete()),Oe.clear()}function We(){Oe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ue=!0)})}class Ye{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oe.add(this),Ie||(Ie=!0,nt.read(We),nt.resolveKeyframes(Ne))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0: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])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Oe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const $e=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Xe=t=>e=>"string"==typeof e&&e.startsWith(t),Ke=Xe("--"),ze=Xe("var(--"),He=t=>!!ze(t)&&Ge.test(t.split("/*")[0].trim()),Ge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ze(t,e,n=1){const[i,s]=function(t){const e=qe.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return $e(t)?parseFloat(t):t}return He(s)?Ze(s,e,n+1):s}const _e=t=>e=>e.test(t),Je=[It,Jt,_t,Zt,te,Qt,{test:t=>"auto"===t,parse:t=>t}],Qe=t=>Je.find(_e(t));class tn extends Ye{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(),He(i))){const s=Ze(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!lt.has(n)||2!==t.length)return;const[i,s]=t,o=Qe(i),r=Qe(s);if(o!==r)if(Le(o)&&Le(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||Ft(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!we.has(e)&&re(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Te(n,s)}(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=Fe[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(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Fe[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const en=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!he.test(t)&&"0"!==t||t.startsWith("url(")));function nn(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=en(s,e),a=en(o,e);return!(!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||D(n))&&i)}const sn=t=>null!==t;function on(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class rn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=dt.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(We(),Ne()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=dt.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!nn(t,n,i,s)){if(!o)return a&&a(on(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const an=(t,e,n)=>t+(e-t)*n;function ln(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 un(t,e){return n=>n>0?e:t}const hn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},cn=[Gt,Ht,ne];function dn(t){const e=(n=t,cn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===ne&&(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=ln(a,i,t+1/3),o=ln(a,i,t),r=ln(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 pn=(t,e)=>{const n=dn(t),i=dn(e);if(!n||!i)return un(t,e);const s={...n};return t=>(s.red=hn(n.red,i.red,t),s.green=hn(n.green,i.green,t),s.blue=hn(n.blue,i.blue,t),s.alpha=an(n.alpha,i.alpha,t),Ht.transform(s))},mn=(t,e)=>n=>e(t(n)),fn=(...t)=>t.reduce(mn),vn=new Set(["none","hidden"]);function gn(t,e){return n=>an(t,e,n)}function yn(t){return"number"==typeof t?gn:"string"==typeof t?He(t)?un:ie.test(t)?pn:Tn:Array.isArray(t)?xn:"object"==typeof t?ie.test(t)?pn:Pn:un}function xn(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>yn(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Pn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=yn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Tn=(t,e)=>{const n=he.createTransformer(e),i=re(t),s=re(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?vn.has(t)&&!s.values.length||vn.has(e)&&!i.values.length?function(t,e){return vn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):fn(xn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):un(t,e)};function wn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return an(t,e,n);return yn(t)(t,e)}function Sn(t,e,n){const i=Math.max(e-5,0);return vt(n-t(i),e-i)}const bn=100,An=10,En=1,Vn=0,Mn=800,Dn=.3,Cn=.3,kn={granular:.01,default:2},Rn={granular:.005,default:.5},Ln=.01,Bn=10,jn=.05,Fn=1;function On({duration:t=Mn,bounce:e=Dn,velocity:n=Vn,mass:i=En}){let s,o,r=1-e;r=Ot(jn,Fn,r),t=Ot(Ln,Bn,b(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/In(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=In(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(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<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=S(t),isNaN(a))return{stiffness:bn,damping:An,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function In(t,e){return t*Math.sqrt(1-e*e)}const Un=["duration","bounce"],Nn=["stiffness","damping","mass"];function Wn(t,e){return e.some(e=>void 0!==t[e])}function Yn(t=Cn,e=Dn){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:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Vn,stiffness:bn,damping:An,mass:En,isResolvedFromDuration:!1,...t};if(!Wn(t,Nn)&&Wn(t,Un))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ot(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:En,stiffness:s,damping:o}}else{const n=On(t);e={...e,...n,mass:En},e.isResolvedFromDuration=!0}return e}({...n,velocity:-b(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*h)),v=r-o,g=b(Math.sqrt(l/h)),y=Math.abs(v)<5;let x;if(i||(i=y?kn.granular:kn.default),s||(s=y?Rn.granular:Rn.default),f<1){const t=In(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const P={calculatedDuration:p&&c||null,next:t=>{const e=x(t);if(p)a.done=t>=c;else{let n=0;f<1&&(n=0===t?S(m):Sn(x,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(M(P),2e4),e=j(e=>P.next(t*e).value,t,30);return t+"ms "+e}};return P}function $n({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},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=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let P,T;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Yn({keyframes:[d.value,p(d.value)],velocity:Sn(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),w(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const Xn=Et(.42,0,1,1),Kn=Et(0,0,.58,1),zn=Et(.42,0,.58,1),Hn={linear:x,easeIn:Xn,easeInOut:zn,easeOut:Kn,circIn:Lt,circInOut:jt,circOut:Bt,backIn:Ct,backInOut:kt,backOut:Dt,anticipate:Rt},Gn=t=>{if(k(t)){P(4===t.length);const[e,n,i,s]=t;return Et(e,n,i,s)}return"string"==typeof t?Hn[t]:t};function qn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(P(o===e.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||wn,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]||x:e;o=fn(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=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=w(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ot(t[0],t[o-1],e)):u}function Zn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=w(0,e,i);t.push(an(n,1,s))}}(e,t.length-1),e}function _n({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Gn):Gn(i),o={done:!1,value:e[0]},r=qn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Zn(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||zn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const Jn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>nt.update(e,!0),stop:()=>it(e),now:()=>st.isProcessing?st.timestamp:dt.now()}},Qn={decay:$n,inertia:$n,tween:_n,keyframes:_n,spring:Yn},ti=t=>t/100;class ei extends rn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Ye;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=D(e)?e:Qn[e]||_n;let a,l;r!==_n&&"number"!=typeof t[0]&&(a=fn(ti,wn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=M(u));const{calculatedDuration:h}=u,c=h+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=n;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/h)):"mirror"===p&&(x=o)),y=Ot(0,1,n)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:T}=P;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return w&&void 0!==i&&(P.value=on(a,this.options,i)),f&&f(P.value),w&&this.finish(),P}get duration(){const{resolved:t}=this;return t?b(t.calculatedDuration):0}get time(){return b(this.currentTime)}set time(t){t=S(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=b(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Jn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const ni=new Set(["opacity","clipPath","filter","transform"]);function ii(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&B()?j(e,n):k(e)?O(e):Array.isArray(e)?e.map(e=>t(e,n)||I.easeOut):I[e]:void 0}(a,s);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const si=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const oi={anticipate:Rt,backInOut:kt,circInOut:jt};class ri extends rn{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new tn(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&B()&&s in oi&&(s=oi[s]),D((u=this.options).type)||"spring"===u.type||!F(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new ei({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,i=h.times,s=h.ease,o="keyframes"}const h=ii(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(C(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;r.set(on(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return b(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return b(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=S(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return x;const{animation:n}=e;C(n,t)}else this.pendingTimeline=t;return x}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new ei({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),c=S(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return si()&&n&&ni.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const ai={type:"spring",stiffness:500,damping:25,restSpeed:10},li={type:"keyframes",duration:.8},ui={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hi=(t,{keyframes:e})=>e.length>2?li:at.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ai:ui;const ci=(t,e,n,i={},s,o)=>r=>{const a=V(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=S(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,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:u,...h}){return!!Object.keys(h).length})(a)||(h={...h,...hi(t,h)}),h.duration&&(h.duration=S(h.duration)),h.repeatDelay&&(h.repeatDelay=S(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),h.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=on(h.keyframes,a);if(void 0!==t)return nt.update(()=>{h.onUpdate(t),h.onComplete()}),new E([])}return!o&&ri.supports(h)?new ri(h):new ei(h)};function di({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function pi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||h&&di(h,e))continue;const a={delay:n,...V(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=bt(t);if(n){const t=window.MotionHandoffAnimation(n,e,nt);null!==t&&(a.startTime=t,c=!0)}}Tt(t,e),i.start(ci(e,i,s,t.shouldReduceMotion&&lt.has(e)?{type:!1}:a,t,c));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{nt.update(()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){xt(t,e,(r=o[e],ut(r)?r[r.length-1]||0:r))}var r}(t,a)})}),u}function mi(t,e,n={}){var i;const s=y(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(pi(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(fi).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(mi(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function fi(t,e){return t.sortNodePosition(e)}function vi(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}function gi(t){return"string"==typeof t||Array.isArray(t)}const yi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xi=["initial",...yi],Pi=xi.length;const Ti=[...yi].reverse(),wi=yi.length;function Si(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=>mi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=mi(t,e,n);else{const s="function"==typeof e?y(t,e,n.custom):e;i=Promise.all(pi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function bi(t){let e=Si(t),n=Vi(),i=!0;const s=e=>(n,i)=>{var s;const o=y(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<Pi;t++){const i=xi[t],s=e.props[i];(gi(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<wi;e++){const d=Ti[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],v=gi(m),g=d===o?p.isActive:null;!1===g&&(c=e);let y=m===a[d]&&m!==r[d]&&v;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===g||!m&&!p.prevProp||f(m)||"boolean"==typeof m)continue;const x=Ai(p.prevProp,m);let P=x||d===o&&p.isActive&&!y&&v||e>c&&v,T=!1;const w=Array.isArray(m)?m:[m];let S=w.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:b={}}=p,A={...b,...S},E=e=>{P=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=b[t];if(h.hasOwnProperty(t))continue;let i=!1;i=ut(e)&&ut(n)?!vi(e,n):e!==n,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(P=!1);const V=!(y&&x)||T;P&&V&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=y(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?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){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Vi(),i=!0}}}function Ai(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!vi(e,t)}function Ei(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vi(){return{animate:Ei(!0),whileInView:Ei(),whileHover:Ei(),whileTap:Ei(),whileDrag:Ei(),whileFocus:Ei(),exit:Ei()}}class Mi{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Di=0;const Ci={animation:{Feature:class extends Mi{constructor(t){super(t),t.animationState||(t.animationState=bi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();f(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(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Mi{constructor(){super(...arguments),this.id=Di++}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 ki(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Ri(t){return{point:{x:t.pageX,y:t.pageY}}}function Li(t,e,n,i){return ki(t,e,(t=>e=>K(e)&&t(e,Ri(e)))(n),i)}function Bi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ji(t){return t.max-t.min}function Fi(t,e,n,i=.5){t.origin=i,t.originPoint=an(e.min,e.max,t.origin),t.scale=ji(n)/ji(e),t.translate=an(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 Oi(t,e,n,i){Fi(t.x,e.x,n.x,i?i.originX:void 0),Fi(t.y,e.y,n.y,i?i.originY:void 0)}function Ii(t,e,n){t.min=n.min+e.min,t.max=t.min+ji(e)}function Ui(t,e,n){t.min=e.min-n.min,t.max=t.min+ji(e)}function Ni(t,e,n){Ui(t.x,e.x,n.x),Ui(t.y,e.y,n.y)}const Wi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Yi(t){return[t("x"),t("y")]}function $i(t){return void 0===t||1===t}function Xi({scale:t,scaleX:e,scaleY:n}){return!$i(t)||!$i(e)||!$i(n)}function Ki(t){return Xi(t)||zi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zi(t){return Hi(t.x)||Hi(t.y)}function Hi(t){return t&&"0%"!==t}function Gi(t,e,n){return n+e*(t-n)}function qi(t,e,n,i,s){return void 0!==s&&(t=Gi(t,s,i)),Gi(t,n,i)+e}function Zi(t,e=0,n=1,i,s){t.min=qi(t.min,e,n,i,s),t.max=qi(t.max,e,n,i,s)}function _i(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}function Ji(t,e){t.min=t.min+e,t.max=t.max+e}function Qi(t,e,n,i,s=.5){Zi(t,e,n,an(t.min,t.max,s),i)}function ts(t,e){Qi(t.x,e.x,e.scaleX,e.scale,e.originX),Qi(t.y,e.y,e.scaleY,e.scale,e.originY)}function es(t,e){return Bi(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 ns=({current:t})=>t?t.ownerDocument.defaultView:null;function is(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const ss=(t,e)=>Math.abs(t-e);class os{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=ls(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=ss(t.x,e.x),i=ss(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=st;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=rs(e,this.transformPagePoint),nt.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=ls("pointercancel"===t.type?this.lastMoveEventInfo:rs(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!K(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=rs(Ri(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=st;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,ls(o,this.history)),this.removeListeners=fn(Li(this.contextWindow,"pointermove",this.handlePointerMove),Li(this.contextWindow,"pointerup",this.handlePointerUp),Li(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),it(this.updatePoint)}}function rs(t,e){return e?{point:e(t.point)}:t}function as(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ls({point:t},e){return{point:t,delta:as(t,hs(e)),offset:as(t,us(e)),velocity:cs(e,.1)}}function us(t){return t[0]}function hs(t){return t[t.length-1]}function cs(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=hs(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>S(e)));)n--;if(!i)return{x:0,y:0};const o=b(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 ds(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 ps(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 ms=.35;function fs(t,e,n){return{min:vs(t,e),max:vs(t,n)}}function vs(t,e){return"number"==typeof t?t:t[e]||0}const gs=new WeakMap;class ys{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.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new os(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Ri(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?U[o]?null:(U[o]=!0,()=>{U[o]=!1}):U.x||U.y?null:(U.x=U.y=!0,()=>{U.x=U.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yi(t=>{let e=this.getAxisMotionValue(t).get()||0;if(_t.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=ji(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&nt.postRender(()=>s(t,e)),Tt(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,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.stop(t,e),resumeAnimation:()=>Yi(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ns(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&nt.postRender(()=>s(t,e))}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||!xs(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?an(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?an(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&is(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ds(t.x,n,s),y:ds(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=ms){return!1===t?t=0:!0===t&&(t=ms),{x:fs(t,"left","right"),y:fs(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Yi(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}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!is(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=es(t,n),{scroll:s}=e;return s&&(Ji(i.x,s.offset.x),Ji(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ps(t.x,e.x),y:ps(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=Bi(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Yi(r=>{if(!xs(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Tt(this.visualElement,t),n.start(ci(t,n,0,e,this.visualElement,!1))}stopAnimation(){Yi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yi(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.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){Yi(e=>{const{drag:n}=this.getProps();if(!xs(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]-an(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!is(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yi(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=ji(t),s=ji(e);return s>i?n=w(e.min,e.max-i,t.min):i>s&&(n=w(t.min,t.max-s,e.min)),Ot(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(),Yi(e=>{if(!xs(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(an(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;gs.set(this.visualElement,this);const t=Li(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();is(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()),nt.read(e);const s=ki(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Yi(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=ms,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function xs(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ps=t=>(e,n)=>{t&&nt.postRender(()=>t(e,n))};const Ts=new WeakMap;const ws={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"]},Ss={};for(const t in ws)Ss[t]={isEnabled:e=>ws[t].some(t=>!!e[t])};const bs="undefined"!=typeof window,As={current:null},Es={current:!1};const Vs=[...Je,ie,he];function Ms(t){return f(t.animate)||xi.some(e=>gi(t[e]))}function Ds(t){return Boolean(Ms(t)||t.variants)}const Cs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ks extends class{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=Ye,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=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,nt.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,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=Ms(e),this.isVariantNode=Ds(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Pt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ts.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)),Es.current||function(){if(Es.current=!0,bs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>As.current=t.matches;t.addListener(e),e()}else As.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||As.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),it(this.notifyUpdate),it(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=at.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&nt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),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 Ss){const e=Ss[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<Cs.length;e++){const n=Cs[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(Pt(s))t.addValue(i,s);else if(Pt(o))t.addValue(i,yt(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,yt(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(),this.onUpdate&&this.onUpdate(this)}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=yt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&($e(i)||Ft(i))?i=parseFloat(i):(s=i,!Vs.find(_e(s))&&he.test(e)&&(i=Te(t,e))),this.setBaseTarget(t,Pt(i)?i.get():i)),Pt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=g(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Pt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ft),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=tn}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;Pt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const Rs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ls={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bs=rt.length;function js(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(at.has(t))r=!0;else if(Ke(t))s[t]=n;else{const e=Rs(n,ye[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<Bs;o++){const r=rt[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=Rs(a,ye[r]);if(!l){s=!1;i+=`${Ls[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 Fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Os={offset:"strokeDashoffset",array:"strokeDasharray"};function Is(t,e,n){return"string"==typeof t?t:Jt.transform(e+n*t)}function Us(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(js(t,u,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Is(e,t.x,t.width)} ${Is(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Fs:Os;t[o.offset]=Jt.transform(-i);const r=Jt.transform(e),a=Jt.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const Ns=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"]),Ws=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ys(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function $s(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}function Xs(t,e,n,i){$s(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ns.has(n)?n:wt(n),e.attrs[n])}const Ks={};function zs(t,{layout:e,layoutId:n}){return at.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ks[t]||"opacity"===t)}function Hs(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Pt(s[r])||e.style&&Pt(e.style[r])||zs(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}function Gs(t,e,n){const i=Hs(t,e,n);for(const n in t)if(Pt(t[n])||Pt(e[n])){i[-1!==rt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class qs extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wi,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Ys(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(at.has(e)){const t=Pe(e);return t&&t.default||0}return e=Ns.has(e)?e:wt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Gs(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&nt.postRender(this.updateDimensions)}build(t,e,n){Us(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Xs(t,e,0,i)}mount(t){this.isSVGTag=Ws(t.tagName),super.mount(t)}}class Zs extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=$s}readValueFromInstance(t,e){if(at.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ke(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Ke(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return es(t,e)}build(t,e,n){js(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Hs(t,e,n)}}const{schedule:_s,cancel:Js}=et(queueMicrotask,!1),Qs=(t,e)=>t.depth-e.depth;class to{constructor(){this.children=[],this.isDirty=!1}add(t){pt(this.children,t),this.isDirty=!0}remove(t){mt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qs),this.isDirty=!1,this.children.forEach(t)}}function eo(t){const e=Pt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const no=["TopLeft","TopRight","BottomLeft","BottomRight"],io=no.length,so=t=>"string"==typeof t?parseFloat(t):t,oo=t=>"number"==typeof t||Jt.test(t);function ro(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ao=uo(0,.5,Bt),lo=uo(.5,.95,x);function uo(t,e,n){return i=>i<t?0:i>e?1:n(w(t,e,i))}function ho(t,e){t.min=e.min,t.max=e.max}function co(t,e){ho(t.x,e.x),ho(t.y,e.y)}function po(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function mo(t,e,n,i,s){return t=Gi(t-=e,1/n,i),void 0!==s&&(t=Gi(t,1/s,i)),t}function fo(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(_t.test(e)){e=parseFloat(e);e=an(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=an(o.min,o.max,i);t===o&&(a-=e),t.min=mo(t.min,e,n,a,s),t.max=mo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const vo=["x","scaleX","originX"],go=["y","scaleY","originY"];function yo(t,e,n,i){fo(t.x,e,vo,n?n.x:void 0,i?i.x:void 0),fo(t.y,e,go,n?n.y:void 0,i?i.y:void 0)}function xo(t){return 0===t.translate&&1===t.scale}function Po(t){return xo(t.x)&&xo(t.y)}function To(t,e){return t.min===e.min&&t.max===e.max}function wo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function So(t,e){return wo(t.x,e.x)&&wo(t.y,e.y)}function bo(t){return ji(t.x)/ji(t.y)}function Ao(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Eo{constructor(){this.members=[]}add(t){pt(this.members,t),t.scheduleRender()}remove(t){if(mt(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 Vo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Mo=["","X","Y","Z"],Do={visibility:"hidden"};let Co=0;function ko(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ro({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=Co++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jo),this.nodes.forEach(Yo),this.nodes.forEach($o),this.nodes.forEach(Fo)},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 to)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ft),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,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=dt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(it(i),t(o-e))};return nt.read(i,!0),()=>it(i)}(i,250),Vo.hasAnimatedSinceResize&&(Vo.hasAnimatedSinceResize=!1,this.nodes.forEach(Wo))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&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||r.getDefaultTransition()||qo,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!So(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...V(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Wo(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,it(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(Xo),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&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const i=bt(n);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",nt,!(t||n))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(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(Io);this.isUpdating||this.nodes.forEach(Uo),this.isUpdating=!1,this.nodes.forEach(No),this.nodes.forEach(Lo),this.nodes.forEach(Bo),this.clearAllSnapshots();const t=dt.now();st.delta=Ot(0,1e3/60,t-st.timestamp),st.timestamp=t,st.isProcessing=!0,ot.update.process(st),ot.preRender.process(st),ot.render.process(st),st.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_s.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Oo),this.sharedNodes.forEach(Ko)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ji(this.snapshot.measuredBox.x)||ji(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){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&&!Po(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Ki(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)),Jo((i=n).x),Jo(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(tr))){const{scroll:t}=this.root;t&&(Ji(n.x,t.offset.x),Ji(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(co(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){const i=this.path[e],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&co(n,t),Ji(n.x,s.offset.x),Ji(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};co(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&&ts(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Ki(i.latestValues)&&ts(n,i.latestValues)}return Ki(this.latestValues)&&ts(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};co(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Ki(n.latestValues))continue;Xi(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};co(i,n.measurePageBox()),yo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Ki(this.latestValues)&&yo(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!==st.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=st.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}},Ni(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),co(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;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(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Ii(r.x,a.x,l.x),Ii(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):co(this.target,this.layout.layoutBox),_i(this.target,this.targetDelta)):co(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}},Ni(this.relativeTargetOrigin,this.target,t.target),co(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Xi(this.parent.latestValues)&&!zi(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(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===st.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;co(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=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&&ts(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,_i(t,r)),i&&Ki(o.latestValues)&&ts(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(po(this.prevProjectionDelta.x,this.projectionDelta.x),po(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Oi(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Ao(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ao(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.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(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Go));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;zo(o.x,t.x,n),zo(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ni(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,Ho(p.x,m.x,f.x,v),Ho(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,To(l.x,d.x)&&To(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),co(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=an(0,void 0!==n.opacity?n.opacity:1,ao(i)),t.opacityExit=an(void 0!==e.opacity?e.opacity:1,0,lo(i))):o&&(t.opacity=an(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<io;s++){const o=`border${no[s]}Radius`;let r=ro(e,o),a=ro(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||oo(r)===oo(a)?(t[o]=Math.max(an(so(r),so(a),i),0),(_t.test(a)||_t.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=an(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,h,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(it(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{Vo.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=Pt(t)?t:yt(t);return i.start(ci("",i,e,n)),i.animation}(0,1e3,{...t,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&&Qo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ji(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ji(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}co(e,n),ts(e,s),Oi(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Eo);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(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.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&&ko("z",t,i,this.animationValues);for(let e=0;e<Mo.length;e++)ko("rotate"+Mo[e],t,i,this.animationValues),ko("skew"+Mo[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()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Do;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=eo(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=eo(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Ki(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0: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,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Ks){if(void 0===r[t])continue;const{correct:e,applyTo:n,isCSSVariable:s}=Ks[t],a="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=a}else s?this.options.visualElement.renderState.vars[t]=a:i[t]=a}return this.options.layoutId&&(i.pointerEvents=o===this?eo(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Io),this.root.sharedNodes.clear()}}}function Lo(t){t.updateLayout()}function Bo(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Yi(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=ji(i);i.min=e[t].min,i.max=i.min+s}):Qo(s,n.layoutBox,e)&&Yi(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=ji(e[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}};Oi(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Oi(a,t.applyTransform(i,!0),n.measuredBox):Oi(a,e,n.layoutBox);const l=!Po(r);let u=!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}};Ni(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ni(a,e,o.layoutBox),So(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function jo(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 Fo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Oo(t){t.clearSnapshot()}function Io(t){t.clearMeasurements()}function Uo(t){t.isLayoutDirty=!1}function No(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yo(t){t.resolveTargetDelta()}function $o(t){t.calcProjection()}function Xo(t){t.resetSkewAndRotation()}function Ko(t){t.removeLeadSnapshot()}function zo(t,e,n){t.translate=an(e.translate,0,n),t.scale=an(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ho(t,e,n,i){t.min=an(e.min,n.min,i),t.max=an(e.max,n.max,i)}function Go(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const qo={duration:.45,ease:[.4,0,.1,1]},Zo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),_o=Zo("applewebkit/")&&!Zo("chrome/")?Math.round:x;function Jo(t){t.min=_o(t.min),t.max=_o(t.max)}function Qo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=bo(e),s=bo(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function tr(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const er=Ro({attachResizeListener:(t,e)=>ki(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),nr={current:void 0},ir=Ro({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!nr.current){const t=new er({});t.mount(window),t.setOptions({layoutScroll:!0}),nr.current=t}return nr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function sr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const or={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Jt.test(t))return t;t=parseFloat(t)}return`${sr(t,e.target.x)}% ${sr(t,e.target.y)}%`}},rr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=he.parse(t);if(s.length>5)return i;const o=he.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 u=an(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},ar=n(null);const lr=n({}),ur=n({});class hr extends a{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Ks[e]=t[e],Ke(e)&&(Ks[e].isCSSVariable=!0)}(dr),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Vo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||nt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),_s.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;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 cr(e){const[n,a]=function(t=!0){const e=i(ar);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:a,register:l}=e,u=s();o(()=>{if(t)return l(u)},[t]);const h=r(()=>t&&a&&a(u),[u,a,t]);return!n&&a?[!1,h]:[!0]}(),l=i(lr);return t(hr,{...e,layoutGroup:l,switchLayoutGroup:i(ur),isPresent:n,safeToRemove:a})}const dr={borderRadius:{...or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:or,borderTopRightRadius:or,borderBottomLeftRadius:or,borderBottomRightRadius:or,boxShadow:rr},pr={pan:{Feature:class extends Mi{constructor(){super(...arguments),this.removePointerDownListener=x}onPointerDown(t){this.session=new os(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ns(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ps(t),onStart:Ps(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&nt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Li(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 Mi{constructor(t){super(t),this.removeGroupControls=x,this.removeListeners=x,this.controls=new ys(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||x}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ir,MeasureLayout:cr}};function mr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&nt.postRender(()=>s(e,Ri(e)))}function fr(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&&nt.postRender(()=>s(e,Ri(e)))}const vr=new WeakMap,gr=new WeakMap,yr=t=>{const e=vr.get(t.target);e&&e(t)},xr=t=>{t.forEach(yr)};function Pr(t,e,n){const i=function({root:t,...e}){const n=t||document;gr.has(n)||gr.set(n,{});const i=gr.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(xr,{root:t,...e})),i[s]}(e);return vr.set(t,n),i.observe(t),()=>{vr.delete(t),i.unobserve(t)}}const Tr={some:0,all:1};const wr={inView:{Feature:class extends Mi{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:Tr[i]};return Pr(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 Mi{mount(){const{current:t}=this.node;t&&(this.unmount=_(t,(t,e)=>(fr(this.node,e,"Start"),(t,{success:e})=>fr(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Mi{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=fn(ki(this.node.current,"focus",()=>this.onFocus()),ki(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mi{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=W(t,n),r=t=>{if(!Y(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{Y(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)=>(mr(this.node,e,"Start"),t=>mr(this.node,t,"End"))))}unmount(){}}}},Sr={layout:{ProjectionNode:ir,MeasureLayout:cr}},br=n({strict:!1}),Ar=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Er=n({});function Vr(t){const{initial:e,animate:n}=function(t,e){if(Ms(t)){const{initial:e,animate:n}=t;return{initial:!1===e||gi(e)?e:void 0,animate:gi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Er));return l(()=>({initial:e,animate:n}),[Mr(e),Mr(n)])}function Mr(t){return Array.isArray(t)?t.join(" "):t}const Dr=Symbol.for("motionComponentSymbol");function Cr(t,e,n){return r(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):is(n)&&(n.current=i))},[e])}const kr=bs?u:o;function Rr(t,e,n,s,r){var a,l;const{visualElement:u}=i(Er),d=i(br),p=i(ar),m=i(Ar).reducedMotion,f=h(null);s=s||d.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:u,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,g=i(ur);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&is(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(f.current,n,r,g);const y=h(!1);c(()=>{v&&y.current&&v.update(n,p)});const x=n[St],P=h(Boolean(x)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,x))&&(null===(l=window.MotionHasOptimisedAnimation)||void 0===l?void 0:l.call(window,x)));return kr(()=>{v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),_s.render(v.render),P.current&&v.animationState&&v.animationState.animateChanges())}),o(()=>{v&&(!P.current&&v.animationState&&v.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),v}function Lr({preloadedFeatures:n,createVisualElement:s,useRender:o,useVisualState:r,Component:a}){var l,u;function h(n,l){let u;const h={...i(Ar),...n,layoutId:Br(n)},{isStatic:c}=h,d=Vr(n),p=r(n,c);if(!c&&bs){i(br).strict;const t=function(t){const{drag:e,layout:n}=Ss;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);u=t.MeasureLayout,d.visualElement=Rr(a,p,h,s,t.ProjectionNode)}return e(Er.Provider,{value:d,children:[u&&d.visualElement?t(u,{visualElement:d.visualElement,...h}):null,o(a,n,Cr(p,d.visualElement,l),p,c,d.visualElement)]})}n&&function(t){for(const e in t)Ss[e]={...Ss[e],...t[e]}}(n),h.displayName="motion."+("string"==typeof a?a:`create(${null!==(u=null!==(l=a.displayName)&&void 0!==l?l:a.name)&&void 0!==u?u:""})`);const c=d(h);return c[Dr]=a,c}function Br({layoutId:t}){const e=i(lr).id;return e&&void 0!==t?e+"-"+t:t}const jr=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fr(t,e,n){for(const i in e)Pt(e[i])||zs(i,n)||(t[i]=e[i])}function Or(t,e){const n={};return Fr(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return js(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Ir(t,e){const n={},i=Or(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 Ur=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 Nr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ur.has(t)}let Wr=t=>!Nr(t);try{(Yr=require("@emotion/is-prop-valid").default)&&(Wr=t=>t.startsWith("on")?!Nr(t):Yr(t))}catch(t){}var Yr;const $r=["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 Xr(t){return"string"==typeof t&&!t.includes("-")&&!!($r.indexOf(t)>-1||/[A-Z]/u.test(t))}const Kr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function zr(t,e,n,i){const s=l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Us(n,e,Ws(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Fr(e,t.style,t),s.style={...e,...s.style}}return s}function Hr(t=!1){return(e,n,i,{latestValues:s},o)=>{const r=(Xr(e)?zr:Ir)(n,s,o,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Wr(s)||!0===n&&Nr(s)||!e&&!Nr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),u=e!==p?{...a,...r,ref:i}:{},{children:h}=n,c=l(()=>Pt(h)?h.get():h,[h]);return m(e,{...u,children:c})}}const Gr=t=>(e,n)=>{const s=i(Er),o=i(ar),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:qr(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,e,s,o);return n?r():function(t){const e=h(null);return null===e.current&&(e.current=t()),e.current}(r)};function qr(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=eo(o[t]);let{initial:r,animate:a}=t;const l=Ms(t),u=Ds(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!f(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n<e.length;n++){const i=g(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[h?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Zr={useVisualState:Gr({scrapeMotionValuesFromProps:Hs,createRenderState:jr})},_r=["x","y","width","height","cx","cy","r"],Jr={useVisualState:Gr({scrapeMotionValuesFromProps:Gs,createRenderState:Kr,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(at.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<_r.length;n++){const i=_r[n];t[i]!==e[i]&&(r=!0)}r&&nt.read(()=>{Ys(n,i),nt.render(()=>{Us(i,s,Ws(n.tagName),t.transformTemplate),Xs(n,i)})})}})};function Qr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Lr({...Xr(n)?Jr:Zr,preloadedFeatures:t,useRender:Hr(i),createVisualElement:e,Component:n})}}const ta=Qr({...Ci,...wr,...pr,...Sr},(t,e)=>Xr(t)?new qs(e):new Zs(e,{allowProjection:t!==p}))("div");export{ta as MotionDiv};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useId as s,useEffect as o,useCallback as r,Component as a,useMemo as l,useLayoutEffect as u,useRef as h,useInsertionEffect as c,forwardRef as d,Fragment as p,createElement as m}from"react";function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function v(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=v(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]=v(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function y(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}function x(t,e){-1===t.indexOf(e)&&t.push(e)}function P(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const T=t=>t;let w=T;const S=!1;function b(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class E{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>P(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 V=t=>1e3*t,M=t=>t/1e3;function D(t,e){return e?t*(1e3/e):0}const C=b(()=>void 0!==window.ScrollTimeline);class k extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>C()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function R(t,e){return t?t[e]||t.default||t:void 0}function L(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function B(t){return"function"==typeof t}function j(t,e){t.timeline=e,t.onfinish=null}const F=t=>Array.isArray(t)&&"number"==typeof t[0],O={linearEasing:void 0};function I(t,e){const n=b(t);return()=>{var t;return null!==(t=O[e])&&void 0!==t?t:n()}}const U=I(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),N=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(A(0,s-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`};function W(t){return Boolean("function"==typeof t&&U()||!t||"string"==typeof t&&(t in $||U())||F(t)||Array.isArray(t)&&t.every(W))}const Y=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Y([0,.65,.55,1]),circOut:Y([.55,0,1,.45]),backIn:Y([.31,.01,.66,-.59]),backOut:Y([.33,1.53,.69,.99])};const X=["read","resolveKeyframes","update","preRender","render","postRender"],K={value:null,addProjectionMetrics:null};function z(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=X.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 u(e){r.has(e)&&(h.schedule(e),t()),l++,e(a)}const h={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(u),e&&K.value&&K.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,h.process(t)))}};return h}(o,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:d}=r,p=()=>{const o=performance.now();n=!1,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),u.process(s),h.process(s),c.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:X.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<X.length;e++)r[X[e]].cancel(t)},state:s,steps:r}}const{schedule:H,cancel:G,state:q,steps:Z}=z("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:T,!0),{schedule:_,cancel:J}=z(queueMicrotask,!1);let Q;function tt(){Q=void 0}const et={now:()=>(void 0===Q&&et.set(q.isProcessing||S?q.timestamp:performance.now()),Q),set:t=>{Q=t,queueMicrotask(tt)}},nt={x:!1,y:!1};function it(){return nt.x||nt.y}function st(t,e){const n=function(t,e,n){var i;if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const o=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:s.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function ot(t){return!("touch"===t.pointerType||it())}function rt(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const at=(t,e)=>!!e&&(t===e||at(t,e.parentElement)),lt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ut=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ht=new WeakSet;function ct(t){return e=>{"Enter"===e.key&&t(e)}}function dt(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function pt(t){return lt(t)&&!it()}function mt(t,e,n={}){const[i,s,o]=st(t,n),r=t=>{const n=t.currentTarget;if(!n||!pt(t)||ht.has(n))return;ht.add(n),rt(t,"set");const i=e(n,t),o=(t,e)=>{n.removeEventListener("pointerup",r),n.removeEventListener("pointercancel",a),rt(t,"release"),pt(t)&&ht.has(n)&&(ht.delete(n),"function"==typeof i&&i(t,{success:e}))},r=t=>{const e=!!t.isTrusted&&(i=t,s=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},i.clientX<s.left||i.clientX>s.right||i.clientY<s.top||i.clientY>s.bottom);var i,s;o(t,!e&&(!(n instanceof Element)||at(n,t.target)))},a=t=>{o(t,!1)};n.addEventListener("pointerup",r,s),n.addEventListener("pointercancel",a,s),n.addEventListener("lostpointercapture",a,s)};return i.forEach(t=>{let e=!1;var i;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,i=t,ut.has(i.tagName)||-1!==i.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",r,s),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=ct(()=>{if(ht.has(n))return;dt(n,"down");const t=ct(()=>{dt(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>dt(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}class ft{constructor(t,e={}){this.version="12.6.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=et.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=et.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new E);const n=this.events[t].add(e);return"change"===t?()=>{n(),H.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=et.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return D(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vt(t,e){return new ft(t,e)}const gt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yt=new Set(gt),xt=new Set(["width","height","top","left","right","bottom",...gt]),Pt=t=>Array.isArray(t);function Tt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vt(n))}const wt=t=>Boolean(t&&t.getVelocity);function St(t,e){const n=t.getValue("willChange");if(i=n,Boolean(wt(i)&&i.add))return n.add(e);var i}const bt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),At="data-"+bt("framerAppearId");function Et(t){return t.props[At]}const Vt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Mt(t,e,n,i){if(t===e&&n===i)return T;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=Vt(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:Vt(s(t),e,i)}const Dt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ct=t=>e=>1-t(1-e),kt=Mt(.33,1.53,.69,.99),Rt=Ct(kt),Lt=Dt(Rt),Bt=t=>(t*=2)<1?.5*Rt(t):.5*(2-Math.pow(2,-10*(t-1))),jt=t=>1-Math.sin(Math.acos(t)),Ft=Ct(jt),Ot=Dt(jt),It=t=>/^0[^.\s]+$/u.test(t);const Ut=(t,e,n)=>n>e?e:n<t?t:n,Nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Wt={...Nt,transform:t=>Ut(0,1,t)},Yt={...Nt,default:1},$t=t=>Math.round(1e5*t)/1e5,Xt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Kt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zt=(t,e)=>n=>Boolean("string"==typeof n&&Kt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ht=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Xt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Gt={...Nt,transform:t=>Math.round((t=>Ut(0,255,t))(t))},qt={test:zt("rgb","red"),parse:Ht("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Gt.transform(t)+", "+Gt.transform(e)+", "+Gt.transform(n)+", "+$t(Wt.transform(i))+")"};const Zt={test:zt("#"),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:qt.transform},_t=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Jt=_t("deg"),Qt=_t("%"),te=_t("px"),ee=_t("vh"),ne=_t("vw"),ie={...Qt,parse:t=>Qt.parse(t)/100,transform:t=>Qt.transform(100*t)},se={test:zt("hsl","hue"),parse:Ht("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Qt.transform($t(e))+", "+Qt.transform($t(n))+", "+$t(Wt.transform(i))+")"},oe={test:t=>qt.test(t)||Zt.test(t)||se.test(t),parse:t=>qt.test(t)?qt.parse(t):se.test(t)?se.parse(t):Zt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?qt.transform(t):se.transform(t)},re=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ae=/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 le(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(ae,t=>(oe.test(t)?(i.color.push(o),s.push("color"),n.push(oe.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function ue(t){return le(t).values}function he(t){const{split:e,types:n}=le(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+="number"===e?$t(t[o]):"color"===e?oe.transform(t[o]):t[o]}return s}}const ce=t=>"number"==typeof t?0:t;const de={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Xt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(re))||void 0===n?void 0:n.length)||0)>0},parse:ue,createTransformer:he,getAnimatableNone:function(t){const e=ue(t);return he(t)(e.map(ce))}},pe=new Set(["brightness","contrast","saturate","opacity"]);function me(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=pe.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const fe=/\b([a-z-]*)\(.*?\)/gu,ve={...de,getAnimatableNone:t=>{const e=t.match(fe);return e?e.map(me).join(" "):t}},ge={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te},ye={rotate:Jt,rotateX:Jt,rotateY:Jt,rotateZ:Jt,scale:Yt,scaleX:Yt,scaleY:Yt,scaleZ:Yt,skew:Jt,skewX:Jt,skewY:Jt,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Wt,originX:ie,originY:ie,originZ:te},xe={...Nt,transform:Math.round},Pe={...ge,...ye,zIndex:xe,size:te,fillOpacity:Wt,strokeOpacity:Wt,numOctaves:xe},Te={...Pe,color:oe,backgroundColor:oe,outlineColor:oe,fill:oe,stroke:oe,borderColor:oe,borderTopColor:oe,borderRightColor:oe,borderBottomColor:oe,borderLeftColor:oe,filter:ve,WebkitFilter:ve},we=t=>Te[t];function Se(t,e){let n=we(t);return n!==ve&&(n=de),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const be=new Set(["auto","none","0"]);const Ae=t=>180*t/Math.PI,Ee=t=>{const e=Ae(Math.atan2(t[1],t[0]));return Me(e)},Ve={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ee,rotateZ:Ee,skewX:t=>Ae(Math.atan(t[1])),skewY:t=>Ae(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Me=t=>((t%=360)<0&&(t+=360),t),De=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ce=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:De,scaleY:Ce,scale:t=>(De(t)+Ce(t))/2,rotateX:t=>Me(Ae(Math.atan2(t[6],t[5]))),rotateY:t=>Me(Ae(Math.atan2(-t[2],t[0]))),rotateZ:Ee,rotate:Ee,skewX:t=>Ae(Math.atan(t[4])),skewY:t=>Ae(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Re(t){return t.includes("scale")?1:0}function Le(t,e){if(!t||"none"===t)return Re(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=Ve,s=e}if(!s)return Re(e);const o=i[e],r=s[1].split(",").map(Be);return"function"==typeof o?o(r):r[o]}function Be(t){return parseFloat(t.trim())}const je=t=>t===Nt||t===te,Fe=new Set(["x","y","z"]),Oe=gt.filter(t=>!Fe.has(t));const Ie={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})=>Le(e,"x"),y:(t,{transform:e})=>Le(e,"y")};Ie.translateX=Ie.x,Ie.translateY=Ie.y;const Ue=new Set;let Ne=!1,We=!1;function Ye(){if(We){const t=Array.from(Ue).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 Oe.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])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}We=!1,Ne=!1,Ue.forEach(t=>t.complete()),Ue.clear()}function $e(){Ue.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(We=!0)})}class Xe{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ue.add(this),Ne||(Ne=!0,H.read($e),H.resolveKeyframes(Ye))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0: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])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ue.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ue.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ke=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ze=t=>e=>"string"==typeof e&&e.startsWith(t),He=ze("--"),Ge=ze("var(--"),qe=t=>!!Ge(t)&&Ze.test(t.split("/*")[0].trim()),Ze=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,_e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Je(t,e,n=1){const[i,s]=function(t){const e=_e.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return Ke(t)?parseFloat(t):t}return qe(s)?Je(s,e,n+1):s}const Qe=t=>e=>e.test(t),tn=[Nt,te,Qt,Jt,ne,ee,{test:t=>"auto"===t,parse:t=>t}],en=t=>tn.find(Qe(t));class nn extends Xe{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(),qe(i))){const s=Je(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!xt.has(n)||2!==t.length)return;const[i,s]=t,o=en(i),r=en(s);if(o!==r)if(je(o)&&je(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||It(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!be.has(e)&&le(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Se(n,s)}(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=Ie[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(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=Ie[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const sn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!de.test(t)&&"0"!==t||t.startsWith("url(")));function on(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=sn(s,e),a=sn(o,e);return!(!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||B(n))&&i)}const rn=t=>null!==t;function an(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(rn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class ln{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=et.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||($e(),Ye()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=et.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!on(t,n,i,s)){if(!o)return a&&a(an(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const un=(t,e,n)=>t+(e-t)*n;function hn(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 cn(t,e){return n=>n>0?e:t}const dn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},pn=[Zt,qt,se];function mn(t){const e=(n=t,pn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===se&&(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=hn(a,i,t+1/3),o=hn(a,i,t),r=hn(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 fn=(t,e)=>{const n=mn(t),i=mn(e);if(!n||!i)return cn(t,e);const s={...n};return t=>(s.red=dn(n.red,i.red,t),s.green=dn(n.green,i.green,t),s.blue=dn(n.blue,i.blue,t),s.alpha=un(n.alpha,i.alpha,t),qt.transform(s))},vn=(t,e)=>n=>e(t(n)),gn=(...t)=>t.reduce(vn),yn=new Set(["none","hidden"]);function xn(t,e){return n=>un(t,e,n)}function Pn(t){return"number"==typeof t?xn:"string"==typeof t?qe(t)?cn:oe.test(t)?fn:Sn:Array.isArray(t)?Tn:"object"==typeof t?oe.test(t)?fn:wn:cn}function Tn(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Pn(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function wn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Pn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Sn=(t,e)=>{const n=de.createTransformer(e),i=le(t),s=le(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?yn.has(t)&&!s.values.length||yn.has(e)&&!i.values.length?function(t,e){return yn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):gn(Tn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):cn(t,e)};function bn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return un(t,e,n);return Pn(t)(t,e)}function An(t,e,n){const i=Math.max(e-5,0);return D(n-t(i),e-i)}const En=100,Vn=10,Mn=1,Dn=0,Cn=800,kn=.3,Rn=.3,Ln={granular:.01,default:2},Bn={granular:.005,default:.5},jn=.01,Fn=10,On=.05,In=1;function Un({duration:t=Cn,bounce:e=kn,velocity:n=Dn,mass:i=Mn}){let s,o,r=1-e;r=Ut(On,In,r),t=Ut(jn,Fn,M(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/Nn(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Nn(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(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<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=V(t),isNaN(a))return{stiffness:En,damping:Vn,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Nn(t,e){return t*Math.sqrt(1-e*e)}const Wn=["duration","bounce"],Yn=["stiffness","damping","mass"];function $n(t,e){return e.some(e=>void 0!==t[e])}function Xn(t=Rn,e=kn){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:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Dn,stiffness:En,damping:Vn,mass:Mn,isResolvedFromDuration:!1,...t};if(!$n(t,Yn)&&$n(t,Wn))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*Ut(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Mn,stiffness:s,damping:o}}else{const n=Un(t);e={...e,...n,mass:Mn},e.isResolvedFromDuration=!0}return e}({...n,velocity:-M(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*h)),v=r-o,g=M(Math.sqrt(l/h)),y=Math.abs(v)<5;let x;if(i||(i=y?Ln.granular:Ln.default),s||(s=y?Bn.granular:Bn.default),f<1){const t=Nn(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const P={calculatedDuration:p&&c||null,next:t=>{const e=x(t);if(p)a.done=t>=c;else{let n=0;f<1&&(n=0===t?V(m):An(x,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(L(P),2e4),e=N(e=>P.next(t*e).value,t,30);return t+"ms "+e}};return P}function Kn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},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=c+m,v=void 0===r?f:r(f);v!==f&&(m=v-c);const g=t=>-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let P,T;const w=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(P=t,T=Xn({keyframes:[d.value,p(d.value)],velocity:An(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),w(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const zn=Mt(.42,0,1,1),Hn=Mt(0,0,.58,1),Gn=Mt(.42,0,.58,1),qn={linear:T,easeIn:zn,easeInOut:Gn,easeOut:Hn,circIn:jt,circInOut:Ot,circOut:Ft,backIn:Rt,backInOut:Lt,backOut:kt,anticipate:Bt},Zn=t=>{if(F(t)){w(4===t.length);const[e,n,i,s]=t;return Mt(e,n,i,s)}return"string"==typeof t?qn[t]:t};function _n(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.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||bn,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]||T:e;o=gn(t,o)}i.push(o)}return i}(e,i,s),l=a.length,u=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=A(t[i],t[i+1],n);return a[i](s)};return n?e=>u(Ut(t[0],t[o-1],e)):u}function Jn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=A(0,e,i);t.push(un(n,1,s))}}(e,t.length-1),e}function Qn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Zn):Zn(i),o={done:!1,value:e[0]},r=_n(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Jn(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||Gn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}const ti=t=>{const e=({timestamp:e})=>t(e);return{start:()=>H.update(e,!0),stop:()=>G(e),now:()=>q.isProcessing?q.timestamp:et.now()}},ei={decay:Kn,inertia:Kn,tween:Qn,keyframes:Qn,spring:Xn},ni=t=>t/100;class ii extends ln{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Xe;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=B(e)?e:ei[e]||Qn;let a,l;r!==Qn&&"number"!=typeof t[0]&&(a=gn(ni,bn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=L(u));const{calculatedDuration:h}=u,c=h+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=n;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/h)):"mirror"===p&&(x=o)),y=Ut(0,1,n)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:T}=P;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return w&&void 0!==i&&(P.value=an(a,this.options,i)),f&&f(P.value),w&&this.finish(),P}get duration(){const{resolved:t}=this;return t?M(t.calculatedDuration):0}get time(){return M(this.currentTime)}set time(t){t=V(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=M(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ti,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const si=new Set(["opacity","clipPath","filter","transform"]);function oi(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=function t(e,n){return e?"function"==typeof e&&U()?N(e,n):F(e)?Y(e):Array.isArray(e)?e.map(e=>t(e,n)||$.easeOut):$[e]:void 0}(a,s);Array.isArray(h)&&(u.easing=h);return t.animate(u,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const ri=b(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const ai={anticipate:Bt,backInOut:Lt,circInOut:Ot};class li extends ln{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new nn(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var u;if("string"==typeof s&&U()&&s in ai&&(s=ai[s]),B((u=this.options).type)||"spring"===u.type||!W(u.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new ii({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,i=h.times,s=h.ease,o="keyframes"}const h=oi(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(j(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;r.set(an(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return M(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return M(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=V(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return T;const{animation:n}=e;j(n,t)}else this.pendingTimeline=t;return T}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new ii({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),c=V(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return ri()&&n&&si.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const ui={type:"spring",stiffness:500,damping:25,restSpeed:10},hi={type:"keyframes",duration:.8},ci={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},di=(t,{keyframes:e})=>e.length>2?hi:yt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ui:ci;const pi=(t,e,n,i={},s,o)=>r=>{const a=R(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=V(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,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:u,...h}){return!!Object.keys(h).length})(a)||(h={...h,...di(t,h)}),h.duration&&(h.duration=V(h.duration)),h.repeatDelay&&(h.repeatDelay=V(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),h.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=an(h.keyframes,a);if(void 0!==t)return H.update(()=>{h.onUpdate(t),h.onComplete()}),new k([])}return!o&&li.supports(h)?new li(h):new ii(h)};function mi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function fi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||h&&mi(h,e))continue;const a={delay:n,...R(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=Et(t);if(n){const t=window.MotionHandoffAnimation(n,e,H);null!==t&&(a.startTime=t,c=!0)}}St(t,e),i.start(pi(e,i,s,t.shouldReduceMotion&&xt.has(e)?{type:!1}:a,t,c));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{H.update(()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Tt(t,e,(r=o[e],Pt(r)?r[r.length-1]||0:r))}var r}(t,a)})}),u}function vi(t,e,n={}){var i;const s=y(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(fi(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(gi).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(vi(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function gi(t,e){return t.sortNodePosition(e)}function yi(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}function xi(t){return"string"==typeof t||Array.isArray(t)}const Pi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ti=["initial",...Pi],wi=Ti.length;const Si=[...Pi].reverse(),bi=Pi.length;function Ai(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=>vi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=vi(t,e,n);else{const s="function"==typeof e?y(t,e,n.custom):e;i=Promise.all(fi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Ei(t){let e=Ai(t),n=Di(),i=!0;const s=e=>(n,i)=>{var s;const o=y(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<wi;t++){const i=Ti[t],s=e.props[i];(xi(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;e<bi;e++){const d=Si[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],v=xi(m),g=d===o?p.isActive:null;!1===g&&(c=e);let y=m===a[d]&&m!==r[d]&&v;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===g||!m&&!p.prevProp||f(m)||"boolean"==typeof m)continue;const x=Vi(p.prevProp,m);let P=x||d===o&&p.isActive&&!y&&v||e>c&&v,T=!1;const w=Array.isArray(m)?m:[m];let S=w.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:b={}}=p,A={...b,...S},E=e=>{P=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=S[t],n=b[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Pt(e)&&Pt(n)?!yi(e,n):e!==n,i?null!=e?E(t):u.add(t):void 0!==e&&u.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(h={...h,...S}),i&&t.blockInitialAnimation&&(P=!1);const V=!(y&&x)||T;P&&V&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=y(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?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){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Di(),i=!0}}}function Vi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yi(e,t)}function Mi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Di(){return{animate:Mi(!0),whileInView:Mi(),whileHover:Mi(),whileTap:Mi(),whileDrag:Mi(),whileFocus:Mi(),exit:Mi()}}class Ci{constructor(t){this.isMounted=!1,this.node=t}update(){}}let ki=0;const Ri={animation:{Feature:class extends Ci{constructor(t){super(t),t.animationState||(t.animationState=Ei(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();f(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(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Ci{constructor(){super(...arguments),this.id=ki++}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 Li(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bi(t){return{point:{x:t.pageX,y:t.pageY}}}function ji(t,e,n,i){return Li(t,e,(t=>e=>lt(e)&&t(e,Bi(e)))(n),i)}function Fi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Oi(t){return t.max-t.min}function Ii(t,e,n,i=.5){t.origin=i,t.originPoint=un(e.min,e.max,t.origin),t.scale=Oi(n)/Oi(e),t.translate=un(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 Ui(t,e,n,i){Ii(t.x,e.x,n.x,i?i.originX:void 0),Ii(t.y,e.y,n.y,i?i.originY:void 0)}function Ni(t,e,n){t.min=n.min+e.min,t.max=t.min+Oi(e)}function Wi(t,e,n){t.min=e.min-n.min,t.max=t.min+Oi(e)}function Yi(t,e,n){Wi(t.x,e.x,n.x),Wi(t.y,e.y,n.y)}const $i=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Xi(t){return[t("x"),t("y")]}function Ki(t){return void 0===t||1===t}function zi({scale:t,scaleX:e,scaleY:n}){return!Ki(t)||!Ki(e)||!Ki(n)}function Hi(t){return zi(t)||Gi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Gi(t){return qi(t.x)||qi(t.y)}function qi(t){return t&&"0%"!==t}function Zi(t,e,n){return n+e*(t-n)}function _i(t,e,n,i,s){return void 0!==s&&(t=Zi(t,s,i)),Zi(t,n,i)+e}function Ji(t,e=0,n=1,i,s){t.min=_i(t.min,e,n,i,s),t.max=_i(t.max,e,n,i,s)}function Qi(t,{x:e,y:n}){Ji(t.x,e.translate,e.scale,e.originPoint),Ji(t.y,n.translate,n.scale,n.originPoint)}function ts(t,e){t.min=t.min+e,t.max=t.max+e}function es(t,e,n,i,s=.5){Ji(t,e,n,un(t.min,t.max,s),i)}function ns(t,e){es(t.x,e.x,e.scaleX,e.scale,e.originX),es(t.y,e.y,e.scaleY,e.scale,e.originY)}function is(t,e){return Fi(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 ss=({current:t})=>t?t.ownerDocument.defaultView:null;function os(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const rs=(t,e)=>Math.abs(t-e);class as{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=hs(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=rs(t.x,e.x),i=rs(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=q;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=ls(e,this.transformPagePoint),H.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=hs("pointercancel"===t.type?this.lastMoveEventInfo:ls(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!lt(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=ls(Bi(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=q;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,hs(o,this.history)),this.removeListeners=gn(ji(this.contextWindow,"pointermove",this.handlePointerMove),ji(this.contextWindow,"pointerup",this.handlePointerUp),ji(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),G(this.updatePoint)}}function ls(t,e){return e?{point:e(t.point)}:t}function us(t,e){return{x:t.x-e.x,y:t.y-e.y}}function hs({point:t},e){return{point:t,delta:us(t,ds(e)),offset:us(t,cs(e)),velocity:ps(e,.1)}}function cs(t){return t[0]}function ds(t){return t[t.length-1]}function ps(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=ds(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>V(e)));)n--;if(!i)return{x:0,y:0};const o=M(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 ms(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 fs(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 vs=.35;function gs(t,e,n){return{min:ys(t,e),max:ys(t,n)}}function ys(t,e){return"number"==typeof t?t:t[e]||0}const xs=new WeakMap;class Ps{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.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new as(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Bi(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?nt[o]?null:(nt[o]=!0,()=>{nt[o]=!1}):nt.x||nt.y?null:(nt.x=nt.y=!0,()=>{nt.x=nt.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xi(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Qt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Oi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&H.postRender(()=>s(t,e)),St(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,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.stop(t,e),resumeAnimation:()=>Xi(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ss(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&H.postRender(()=>s(t,e))}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||!Ts(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?un(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?un(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&os(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ms(t.x,n,s),y:ms(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=vs){return!1===t?t=0:!0===t&&(t=vs),{x:gs(t,"left","right"),y:gs(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Xi(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}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!os(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=is(t,n),{scroll:s}=e;return s&&(ts(i.x,s.offset.x),ts(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:fs(t.x,e.x),y:fs(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=Fi(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Xi(r=>{if(!Ts(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return St(this.visualElement,t),n.start(pi(t,n,0,e,this.visualElement,!1))}stopAnimation(){Xi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Xi(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.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){Xi(e=>{const{drag:n}=this.getProps();if(!Ts(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]-un(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!os(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Xi(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=Oi(t),s=Oi(e);return s>i?n=A(e.min,e.max-i,t.min):i>s&&(n=A(t.min,t.max-s,e.min)),Ut(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(),Xi(e=>{if(!Ts(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(un(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;xs.set(this.visualElement,this);const t=ji(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();os(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()),H.read(e);const s=Li(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Xi(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=vs,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Ts(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ws=t=>(e,n)=>{t&&H.postRender(()=>t(e,n))};const Ss=(t,e)=>t.depth-e.depth;class bs{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){P(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ss),this.isDirty=!1,this.children.forEach(t)}}function As(t){const e=wt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Es=["TopLeft","TopRight","BottomLeft","BottomRight"],Vs=Es.length,Ms=t=>"string"==typeof t?parseFloat(t):t,Ds=t=>"number"==typeof t||te.test(t);function Cs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ks=Ls(0,.5,Ft),Rs=Ls(.5,.95,T);function Ls(t,e,n){return i=>i<t?0:i>e?1:n(A(t,e,i))}function Bs(t,e){t.min=e.min,t.max=e.max}function js(t,e){Bs(t.x,e.x),Bs(t.y,e.y)}function Fs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Os(t,e,n,i,s){return t=Zi(t-=e,1/n,i),void 0!==s&&(t=Zi(t,1/s,i)),t}function Is(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(Qt.test(e)){e=parseFloat(e);e=un(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=un(o.min,o.max,i);t===o&&(a-=e),t.min=Os(t.min,e,n,a,s),t.max=Os(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Us=["x","scaleX","originX"],Ns=["y","scaleY","originY"];function Ws(t,e,n,i){Is(t.x,e,Us,n?n.x:void 0,i?i.x:void 0),Is(t.y,e,Ns,n?n.y:void 0,i?i.y:void 0)}function Ys(t){return 0===t.translate&&1===t.scale}function $s(t){return Ys(t.x)&&Ys(t.y)}function Xs(t,e){return t.min===e.min&&t.max===e.max}function Ks(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zs(t,e){return Ks(t.x,e.x)&&Ks(t.y,e.y)}function Hs(t){return Oi(t.x)/Oi(t.y)}function Gs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class qs{constructor(){this.members=[]}add(t){x(this.members,t),t.scheduleRender()}remove(t){if(P(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 Zs={};const _s={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Js=["","X","Y","Z"],Qs={visibility:"hidden"};let to=0;function eo(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function no({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=to++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(oo),this.nodes.forEach(po),this.nodes.forEach(mo),this.nodes.forEach(ro)},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 bs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new E),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,n=this.root.hasTreeAnimated){if(this.instance)return;var i;this.isSVG=(i=e)instanceof SVGElement&&"svg"!==i.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=et.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(G(i),t(o-e))};return H.read(i,!0),()=>G(i)}(i,250),_s.hasAnimatedSinceResize&&(_s.hasAnimatedSinceResize=!1,this.nodes.forEach(co))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&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||r.getDefaultTransition()||Po,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!zs(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...R(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||co(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,G(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(fo),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&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const i=Et(n);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",H,!(t||n))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(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(lo);this.isUpdating||this.nodes.forEach(uo),this.isUpdating=!1,this.nodes.forEach(ho),this.nodes.forEach(io),this.nodes.forEach(so),this.clearAllSnapshots();const t=et.now();q.delta=Ut(0,1e3/60,t-q.timestamp),q.timestamp=t,q.isProcessing=!0,Z.update.process(q),Z.preRender.process(q),Z.render.process(q),q.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ao),this.sharedNodes.forEach(vo)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,H.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){H.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Oi(this.snapshot.measuredBox.x)||Oi(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){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&&!$s(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Hi(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)),So((i=n).x),So(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(Ao))){const{scroll:t}=this.root;t&&(ts(n.x,t.offset.x),ts(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(js(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){const i=this.path[e],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&js(n,t),ts(n.x,s.offset.x),ts(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};js(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&&ns(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Hi(i.latestValues)&&ns(n,i.latestValues)}return Hi(this.latestValues)&&ns(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};js(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Hi(n.latestValues))continue;zi(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};js(i,n.measurePageBox()),Ws(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Hi(this.latestValues)&&Ws(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!==q.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=q.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}},Yi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),js(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,a,l;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(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Ni(r.x,a.x,l.x),Ni(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):js(this.target,this.layout.layoutBox),Qi(this.target,this.targetDelta)):js(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}},Yi(this.relativeTargetOrigin,this.target,t.target),js(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!zi(this.parent.latestValues)&&!Gi(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(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===q.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;js(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=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&&ns(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Qi(t,r)),i&&Hi(o.latestValues)&&ns(t,o.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(Fs(this.prevProjectionDelta.x,this.projectionDelta.x),Fs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ui(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Gs(this.projectionDelta.x,this.prevProjectionDelta.x)&&Gs(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.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(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(xo));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;go(o.x,t.x,n),go(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yi(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,yo(p.x,m.x,f.x,v),yo(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,Xs(l.x,d.x)&&Xs(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),js(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=un(0,void 0!==n.opacity?n.opacity:1,ks(i)),t.opacityExit=un(void 0!==e.opacity?e.opacity:1,0,Rs(i))):o&&(t.opacity=un(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<Vs;s++){const o=`border${Es[s]}Radius`;let r=Cs(e,o),a=Cs(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Ds(r)===Ds(a)?(t[o]=Math.max(un(Ms(r),Ms(a),i),0),(Qt.test(a)||Qt.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=un(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,h,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(G(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=H.update(()=>{_s.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=wt(t)?t:vt(t);return i.start(pi("",i,e,n)),i.animation}(0,1e3,{...t,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&&bo(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Oi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Oi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}js(e,n),ns(e,s),Ui(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new qs);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(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.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&&eo("z",t,i,this.animationValues);for(let e=0;e<Js.length;e++)eo("rotate"+Js[e],t,i,this.animationValues),eo("skew"+Js[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()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Qs;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=As(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=As(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Hi(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0: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,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in Zs){if(void 0===r[t])continue;const{correct:e,applyTo:n,isCSSVariable:s}=Zs[t],a="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=a}else s?this.options.visualElement.renderState.vars[t]=a:i[t]=a}return this.options.layoutId&&(i.pointerEvents=o===this?As(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(lo),this.root.sharedNodes.clear()}}}function io(t){t.updateLayout()}function so(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Xi(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Oi(i);i.min=e[t].min,i.max=i.min+s}):bo(s,n.layoutBox,e)&&Xi(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=Oi(e[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}};Ui(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Ui(a,t.applyTransform(i,!0),n.measuredBox):Ui(a,e,n.layoutBox);const l=!$s(r);let u=!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}};Yi(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Yi(a,e,o.layoutBox),zs(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function oo(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 ro(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ao(t){t.clearSnapshot()}function lo(t){t.clearMeasurements()}function uo(t){t.isLayoutDirty=!1}function ho(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function co(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function po(t){t.resolveTargetDelta()}function mo(t){t.calcProjection()}function fo(t){t.resetSkewAndRotation()}function vo(t){t.removeLeadSnapshot()}function go(t,e,n){t.translate=un(e.translate,0,n),t.scale=un(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function yo(t,e,n,i){t.min=un(e.min,n.min,i),t.max=un(e.max,n.max,i)}function xo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Po={duration:.45,ease:[.4,0,.1,1]},To=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),wo=To("applewebkit/")&&!To("chrome/")?Math.round:T;function So(t){t.min=wo(t.min),t.max=wo(t.max)}function bo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Hs(e),s=Hs(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Ao(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Eo=no({attachResizeListener:(t,e)=>Li(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vo={current:void 0},Mo=no({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vo.current){const t=new Eo({});t.mount(window),t.setOptions({layoutScroll:!0}),Vo.current=t}return Vo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Do(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Co={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!te.test(t))return t;t=parseFloat(t)}return`${Do(t,e.target.x)}% ${Do(t,e.target.y)}%`}},ko={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=de.parse(t);if(s.length>5)return i;const o=de.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 u=un(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},Ro={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"]},Lo={};for(const t in Ro)Lo[t]={isEnabled:e=>Ro[t].some(t=>!!e[t])};const Bo="undefined"!=typeof window,jo={current:null},Fo={current:!1};const Oo=[...tn,oe,de],Io=new WeakMap;function Uo(t){return f(t.animate)||Ti.some(e=>xi(t[e]))}function No(t){return Boolean(Uo(t)||t.variants)}const Wo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Yo extends class{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=Xe,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=et.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,H.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,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=Uo(e),this.isVariantNode=No(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&wt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Io.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)),Fo.current||function(){if(Fo.current=!0,Bo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>jo.current=t.matches;t.addListener(e),e()}else jo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||jo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),G(this.notifyUpdate),G(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=yt.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&H.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),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 Lo){const e=Lo[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<Wo.length;e++){const n=Wo[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(wt(s))t.addValue(i,s);else if(wt(o))t.addValue(i,vt(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,vt(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(),this.onUpdate&&this.onUpdate(this)}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=vt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&(Ke(i)||It(i))?i=parseFloat(i):(s=i,!Oo.find(Qe(s))&&de.test(e)&&(i=Se(t,e))),this.setBaseTarget(t,wt(i)?i.get():i)),wt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=g(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||wt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new E),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=nn}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;wt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const $o=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Xo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ko=gt.length;function zo(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(yt.has(t))r=!0;else if(He(t))s[t]=n;else{const e=$o(n,Pe[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<Ko;o++){const r=gt[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=$o(a,Pe[r]);if(!l){s=!1;i+=`${Xo[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}`}}function Ho(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}function Go(t,{layout:e,layoutId:n}){return yt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Zs[t]||"opacity"===t)}function qo(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(wt(s[r])||e.style&&wt(e.style[r])||Go(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}class Zo extends Yo{constructor(){super(...arguments),this.type="html",this.renderInstance=Ho}readValueFromInstance(t,e){if(yt.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Le(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(He(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return is(t,e)}build(t,e,n){zo(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return qo(t,e,n)}}const _o=n(null);const Jo=n({}),Qo=n({});class tr extends a{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Zs[e]=t[e],He(e)&&(Zs[e].isCSSVariable=!0)}(nr),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),_s.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||H.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),_.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;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 er(e){const[n,a]=function(t=!0){const e=i(_o);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:a,register:l}=e,u=s();o(()=>{if(t)return l(u)},[t]);const h=r(()=>t&&a&&a(u),[u,a,t]);return!n&&a?[!1,h]:[!0]}(),l=i(Jo);return t(tr,{...e,layoutGroup:l,switchLayoutGroup:i(Qo),isPresent:n,safeToRemove:a})}const nr={borderRadius:{...Co,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Co,borderTopRightRadius:Co,borderBottomLeftRadius:Co,borderBottomRightRadius:Co,boxShadow:ko},ir={pan:{Feature:class extends Ci{constructor(){super(...arguments),this.removePointerDownListener=T}onPointerDown(t){this.session=new as(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ss(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ws(t),onStart:ws(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&H.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=ji(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 Ci{constructor(t){super(t),this.removeGroupControls=T,this.removeListeners=T,this.controls=new Ps(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||T}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Mo,MeasureLayout:er}};function sr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&H.postRender(()=>s(e,Bi(e)))}function or(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&&H.postRender(()=>s(e,Bi(e)))}const rr=new WeakMap,ar=new WeakMap,lr=t=>{const e=rr.get(t.target);e&&e(t)},ur=t=>{t.forEach(lr)};function hr(t,e,n){const i=function({root:t,...e}){const n=t||document;ar.has(n)||ar.set(n,{});const i=ar.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ur,{root:t,...e})),i[s]}(e);return rr.set(t,n),i.observe(t),()=>{rr.delete(t),i.unobserve(t)}}const cr={some:0,all:1};const dr={inView:{Feature:class extends Ci{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:cr[i]};return hr(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 Ci{mount(){const{current:t}=this.node;t&&(this.unmount=mt(t,(t,e)=>(or(this.node,e,"Start"),(t,{success:e})=>or(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Ci{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=gn(Li(this.node.current,"focus",()=>this.onFocus()),Li(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Ci{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=st(t,n),r=t=>{if(!ot(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{ot(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)=>(sr(this.node,e,"Start"),t=>sr(this.node,t,"End"))))}unmount(){}}}},pr={layout:{ProjectionNode:Mo,MeasureLayout:er}},mr=n({strict:!1}),fr=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),vr=n({});function gr(t){const{initial:e,animate:n}=function(t,e){if(Uo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||xi(e)?e:void 0,animate:xi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(vr));return l(()=>({initial:e,animate:n}),[yr(e),yr(n)])}function yr(t){return Array.isArray(t)?t.join(" "):t}const xr=Symbol.for("motionComponentSymbol");function Pr(t,e,n){return r(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):os(n)&&(n.current=i))},[e])}const Tr=Bo?u:o;function wr(t,e,n,s,r){var a,l;const{visualElement:u}=i(vr),d=i(mr),p=i(_o),m=i(fr).reducedMotion,f=h(null);s=s||d.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:u,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:m}));const v=f.current,g=i(Qo);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){return e?!1!==e.options.allowProjection?e.projection:t(e.parent):void 0}(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&os(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(f.current,n,r,g);const y=h(!1);c(()=>{v&&y.current&&v.update(n,p)});const x=n[At],P=h(Boolean(x)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,x))&&(null===(l=window.MotionHasOptimisedAnimation)||void 0===l?void 0:l.call(window,x)));return Tr(()=>{v&&(y.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),_.render(v.render),P.current&&v.animationState&&v.animationState.animateChanges())}),o(()=>{v&&(!P.current&&v.animationState&&v.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),P.current=!1))}),v}function Sr({preloadedFeatures:n,createVisualElement:s,useRender:o,useVisualState:r,Component:a}){var l,u;function h(n,l){let u;const h={...i(fr),...n,layoutId:br(n)},{isStatic:c}=h,d=gr(n),p=r(n,c);if(!c&&Bo){i(mr).strict;const t=function(t){const{drag:e,layout:n}=Lo;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);u=t.MeasureLayout,d.visualElement=wr(a,p,h,s,t.ProjectionNode)}return e(vr.Provider,{value:d,children:[u&&d.visualElement?t(u,{visualElement:d.visualElement,...h}):null,o(a,n,Pr(p,d.visualElement,l),p,c,d.visualElement)]})}n&&function(t){for(const e in t)Lo[e]={...Lo[e],...t[e]}}(n),h.displayName="motion."+("string"==typeof a?a:`create(${null!==(u=null!==(l=a.displayName)&&void 0!==l?l:a.name)&&void 0!==u?u:""})`);const c=d(h);return c[xr]=a,c}function br({layoutId:t}){const e=i(Jo).id;return e&&void 0!==t?e+"-"+t:t}const Ar=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Er(t,e,n){for(const i in e)wt(e[i])||Go(i,n)||(t[i]=e[i])}function Vr(t,e){const n={};return Er(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return zo(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Mr(t,e){const n={},i=Vr(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 Dr=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 Cr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Dr.has(t)}let kr=t=>!Cr(t);try{(Rr=require("@emotion/is-prop-valid").default)&&(kr=t=>t.startsWith("on")?!Cr(t):Rr(t))}catch(t){}var Rr;const Lr=["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 Br(t){return"string"==typeof t&&!t.includes("-")&&!!(Lr.indexOf(t)>-1||/[A-Z]/u.test(t))}const jr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Fr={offset:"strokeDashoffset",array:"strokeDasharray"};function Or(t,e,n){return"string"==typeof t?t:te.transform(e+n*t)}function Ir(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(zo(t,u,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Or(e,t.x,t.width)} ${Or(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?jr:Fr;t[o.offset]=te.transform(-i);const r=te.transform(e),a=te.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,l,!1)}const Ur=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Nr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Wr(t,e,n,i){const s=l(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ir(n,e,Nr(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Er(e,t.style,t),s.style={...e,...s.style}}return s}function Yr(t=!1){return(e,n,i,{latestValues:s},o)=>{const r=(Br(e)?Wr:Mr)(n,s,o,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(kr(s)||!0===n&&Cr(s)||!e&&!Cr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),u=e!==p?{...a,...r,ref:i}:{},{children:h}=n,c=l(()=>wt(h)?h.get():h,[h]);return m(e,{...u,children:c})}}const $r=t=>(e,n)=>{const s=i(vr),o=i(_o),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:Xr(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,e,s,o);return n?r():function(t){const e=h(null);return null===e.current&&(e.current=t()),e.current}(r)};function Xr(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=As(o[t]);let{initial:r,animate:a}=t;const l=Uo(t),u=No(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!f(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n<e.length;n++){const i=g(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[h?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Kr={useVisualState:$r({scrapeMotionValuesFromProps:qo,createRenderState:Ar})};function zr(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}const Hr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Gr(t,e,n,i){Ho(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Hr.has(n)?n:bt(n),e.attrs[n])}function qr(t,e,n){const i=qo(t,e,n);for(const n in t)if(wt(t[n])||wt(e[n])){i[-1!==gt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Zr=["x","y","width","height","cx","cy","r"],_r={useVisualState:$r({scrapeMotionValuesFromProps:qr,createRenderState:Ur,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(yt.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<Zr.length;n++){const i=Zr[n];t[i]!==e[i]&&(r=!0)}r&&H.read(()=>{zr(n,i),H.render(()=>{Ir(i,s,Nr(n.tagName),t.transformTemplate),Gr(n,i)})})}})};function Jr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Sr({...Br(n)?_r:Kr,preloadedFeatures:t,useRender:Yr(i),createVisualElement:e,Component:n})}}class Qr extends Yo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$i,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&zr(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(yt.has(e)){const t=we(e);return t&&t.default||0}return e=Hr.has(e)?e:bt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return qr(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&H.postRender(this.updateDimensions)}build(t,e,n){Ir(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Gr(t,e,0,i)}mount(t){this.isSVGTag=Nr(t.tagName),super.mount(t)}}const ta=Jr({...Ri,...dr,...ir,...pr},(t,e)=>Br(t)?new Qr(e):new Zo(e,{allowProjection:t!==p}))("div");export{ta as MotionDiv};