framer-motion 7.2.0 → 7.3.1

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 (96) hide show
  1. package/dist/cjs/index.js +762 -627
  2. package/dist/es/animation/use-animated-state.mjs +3 -5
  3. package/dist/es/animation/utils/default-transitions.mjs +1 -1
  4. package/dist/es/animation/utils/transitions.mjs +28 -26
  5. package/dist/es/components/AnimatePresence/PopChild.mjs +3 -2
  6. package/dist/es/components/AnimatePresence/PresenceChild.mjs +5 -2
  7. package/dist/es/components/AnimatePresence/use-presence.mjs +1 -1
  8. package/dist/es/components/LayoutGroup/index.mjs +4 -5
  9. package/dist/es/components/LazyMotion/index.mjs +3 -5
  10. package/dist/es/components/MotionConfig/index.mjs +2 -4
  11. package/dist/es/components/Reorder/Group.mjs +2 -4
  12. package/dist/es/components/Reorder/Item.mjs +6 -8
  13. package/dist/es/context/MotionContext/utils.mjs +3 -2
  14. package/dist/es/gestures/PanSession.mjs +2 -2
  15. package/dist/es/gestures/drag/VisualElementDragControls.mjs +16 -4
  16. package/dist/es/gestures/use-focus-gesture.mjs +3 -4
  17. package/dist/es/gestures/use-hover-gesture.mjs +4 -3
  18. package/dist/es/gestures/use-tap-gesture.mjs +9 -10
  19. package/dist/es/index.mjs +2 -1
  20. package/dist/es/motion/features/animations.mjs +8 -3
  21. package/dist/es/motion/features/definitions.mjs +1 -13
  22. package/dist/es/motion/features/layout/MeasureLayout.mjs +12 -6
  23. package/dist/es/motion/features/load-features.mjs +14 -0
  24. package/dist/es/motion/features/viewport/observers.mjs +4 -7
  25. package/dist/es/motion/features/viewport/use-viewport.mjs +8 -6
  26. package/dist/es/motion/index.mjs +23 -23
  27. package/dist/es/motion/utils/VisualElementHandler.mjs +2 -5
  28. package/dist/es/motion/utils/is-forced-motion-value.mjs +3 -3
  29. package/dist/es/motion/utils/use-motion-ref.mjs +1 -2
  30. package/dist/es/motion/utils/use-visual-element.mjs +14 -12
  31. package/dist/es/motion/utils/use-visual-state.mjs +19 -16
  32. package/dist/es/motion/utils/valid-prop.mjs +22 -17
  33. package/dist/es/projection/geometry/utils.mjs +10 -1
  34. package/dist/es/projection/node/HTMLProjectionNode.mjs +1 -1
  35. package/dist/es/projection/node/create-projection-node.mjs +62 -20
  36. package/dist/es/projection/use-instant-layout-transition.mjs +2 -2
  37. package/dist/es/render/dom/features-animation.mjs +5 -1
  38. package/dist/es/render/dom/features-max.mjs +6 -1
  39. package/dist/es/render/dom/motion.mjs +6 -1
  40. package/dist/es/render/dom/use-render.mjs +5 -1
  41. package/dist/es/render/dom/utils/camel-to-dash.mjs +1 -3
  42. package/dist/es/render/dom/utils/create-config.mjs +7 -2
  43. package/dist/es/render/dom/utils/css-variables-conversion.mjs +5 -7
  44. package/dist/es/render/dom/utils/unit-conversion.mjs +4 -4
  45. package/dist/es/render/dom/value-types/defaults.mjs +15 -3
  46. package/dist/es/render/dom/value-types/type-int.mjs +4 -1
  47. package/dist/es/render/html/config-motion.mjs +1 -1
  48. package/dist/es/render/html/use-props.mjs +5 -9
  49. package/dist/es/render/html/utils/build-styles.mjs +17 -15
  50. package/dist/es/render/html/utils/build-transform.mjs +8 -18
  51. package/dist/es/render/html/utils/transform.mjs +21 -30
  52. package/dist/es/render/html/visual-element.mjs +8 -9
  53. package/dist/es/render/index.mjs +118 -40
  54. package/dist/es/render/svg/use-props.mjs +5 -2
  55. package/dist/es/render/svg/utils/build-attrs.mjs +3 -5
  56. package/dist/es/render/svg/utils/create-render-state.mjs +4 -1
  57. package/dist/es/render/svg/visual-element.mjs +8 -4
  58. package/dist/es/render/utils/animation-state.mjs +12 -9
  59. package/dist/es/render/utils/animation.mjs +14 -8
  60. package/dist/es/render/utils/is-controlling-variants.mjs +22 -0
  61. package/dist/es/render/utils/is-variant-label.mjs +8 -0
  62. package/dist/es/render/utils/motion-values.mjs +3 -3
  63. package/dist/es/render/utils/resolve-dynamic-variants.mjs +24 -0
  64. package/dist/es/render/utils/resolve-variants.mjs +26 -0
  65. package/dist/es/render/utils/setters.mjs +12 -9
  66. package/dist/es/utils/reduced-motion/index.mjs +19 -0
  67. package/dist/es/utils/reduced-motion/state.mjs +5 -0
  68. package/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +19 -0
  69. package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +43 -0
  70. package/dist/es/utils/transform.mjs +4 -1
  71. package/dist/es/utils/use-in-view.mjs +1 -2
  72. package/dist/es/value/index.mjs +1 -1
  73. package/dist/es/value/use-scroll.mjs +6 -4
  74. package/dist/es/value/use-spring.mjs +7 -1
  75. package/dist/es/value/use-will-change/index.mjs +4 -4
  76. package/dist/es/value/utils/is-motion-value.mjs +1 -3
  77. package/dist/framer-motion.dev.js +806 -670
  78. package/dist/framer-motion.js +1 -1
  79. package/dist/index.d.ts +60 -54
  80. package/dist/projection.dev.js +402 -213
  81. package/dist/size-rollup-dom-animation-assets.js +1 -0
  82. package/dist/size-rollup-dom-animation-m.js +1 -0
  83. package/dist/size-rollup-dom-animation.js +1 -1
  84. package/dist/size-rollup-dom-max-assets.js +1 -0
  85. package/dist/size-rollup-dom-max.js +1 -1
  86. package/dist/size-rollup-m.js +1 -1
  87. package/dist/size-rollup-motion.js +1 -0
  88. package/dist/size-webpack-dom-animation.js +1 -1
  89. package/dist/size-webpack-dom-max.js +1 -1
  90. package/dist/size-webpack-m.js +1 -1
  91. package/dist/three-entry.d.ts +41 -22
  92. package/package.json +12 -8
  93. package/dist/es/motion/features/use-features.mjs +0 -40
  94. package/dist/es/motion/features/use-projection.mjs +0 -33
  95. package/dist/es/render/utils/variants.mjs +0 -73
  96. package/dist/es/utils/use-reduced-motion.mjs +0 -73
@@ -1 +1 @@
1
- import t,{useEffect as e,useRef as n,createContext as i,useContext as o,useId as s}from"react";function r(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function a(t){return!!t.touches}const l={pageX:0,pageY:0};function u(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||l;return{x:n[e+"X"],y:n[e+"Y"]}}function c(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function h(t,e="page"){return{point:a(t)?u(t,e):c(t,e)}}const d=(t,e=!1)=>{const n=e=>t(e,h(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},p="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),m="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(p()),1/60*1e3);let f=!0,g=!1,v=!1;const y={delta:0,timestamp:0},b=["read","update","preRender","render","postRender"],x=b.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>g=!0),t),{}),P=b.reduce((t,e)=>{const n=x[e];return t[e]=(t,e=!1,i=!1)=>(g||S(),n.schedule(t,e,i)),t},{}),w=b.reduce((t,e)=>(t[e]=x[e].cancel,t),{}),A=b.reduce((t,e)=>(t[e]=()=>x[e].process(y),t),{}),T=t=>x[t].process(y),E=t=>{g=!1,y.delta=f?1/60*1e3:Math.max(Math.min(t-y.timestamp,40),1),y.timestamp=t,v=!0,b.forEach(T),v=!1,g&&(f=!1,m(E))},S=()=>{g=!0,f=!0,v||m(E)},V=()=>y,O=t=>1e3*t;function j(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function M(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return j(e,n,i,o)},[t,n,i,o])}const R="undefined"!=typeof document,C={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},L={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function D(t){return R&&null===window.onpointerdown?t:R&&null===window.ontouchstart?L[t]:R&&null===window.onmousedown?C[t]:t}function k(t,e,n,i){return j(t,D(e),d(n,"pointerdown"===e),i)}function F(t,e,n,i){return M(t,D(e),n&&d(n,"pointerdown"===e),i)}function B(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const U=(t,e,n)=>Math.min(Math.max(n,t),e);function I({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=U(.05,1,r),t=U(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/N(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=N(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=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}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function N(t,e){return t*Math.sqrt(1-e*e)}const $=["duration","bounce"],z=["stiffness","damping","mass"];function Y(t,e){return e.some(e=>void 0!==t[e])}function X(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=B(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Y(t,z)&&Y(t,$)){const n=I(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=H,m=H;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=N(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}X.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const H=t=>0,W=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},G=(t,e,n)=>-n*t+n*e+t,q=(t,e)=>n=>Math.max(Math.min(n,e),t),Z=t=>t%1?Number(t.toFixed(5)):t,K=/(-)?([\d]*\.?[\d])+/g,_=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,J=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Q(t){return"string"==typeof t}const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et=Object.assign(Object.assign({},tt),{transform:q(0,1)}),nt=Object.assign(Object.assign({},tt),{default:1}),it=t=>({test:e=>Q(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=it("deg"),st=it("%"),rt=it("px"),at=it("vh"),lt=it("vw"),ut=Object.assign(Object.assign({},st),{parse:t=>st.parse(t)/100,transform:t=>st.transform(100*t)}),ct=(t,e)=>n=>Boolean(Q(n)&&J.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ht=(t,e,n)=>i=>{if(!Q(i))return i;const[o,s,r,a]=i.match(K);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},dt={test:ct("hsl","hue"),parse:ht("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+st.transform(Z(e))+", "+st.transform(Z(n))+", "+Z(et.transform(i))+")"},pt=q(0,255),mt=Object.assign(Object.assign({},tt),{transform:t=>Math.round(pt(t))}),ft={test:ct("rgb","red"),parse:ht("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+mt.transform(t)+", "+mt.transform(e)+", "+mt.transform(n)+", "+Z(et.transform(i))+")"};const gt={test:ct("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:ft.transform},vt={test:t=>ft.test(t)||gt.test(t)||dt.test(t),parse:t=>ft.test(t)?ft.parse(t):dt.test(t)?dt.parse(t):gt.parse(t),transform:t=>Q(t)?t:t.hasOwnProperty("red")?ft.transform(t):dt.transform(t)};function yt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(_);i&&(n=i.length,t=t.replace(_,"${c}"),e.push(...i.map(vt.parse)));const o=t.match(K);return o&&(t=t.replace(K,"${n}"),e.push(...o.map(tt.parse))),{values:e,numColors:n,tokenised:t}}function bt(t){return yt(t).values}function xt(t){const{values:e,numColors:n,tokenised:i}=yt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?vt.transform(t[i]):Z(t[i]));return e}}const Pt=t=>"number"==typeof t?0:t;const wt={test:function(t){var e,n,i,o;return isNaN(t)&&Q(t)&&(null!==(n=null===(e=t.match(K))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(_))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:bt,createTransformer:xt,getAnimatableNone:function(t){const e=bt(t);return xt(t)(e.map(Pt))}},At=new Set(["brightness","contrast","saturate","opacity"]);function Tt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(K)||[];if(!i)return t;const o=n.replace(i,"");let s=At.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Et=/([a-z-]*)\(.*?\)/g,St=Object.assign(Object.assign({},wt),{getAnimatableNone:t=>{const e=t.match(Et);return e?e.map(Tt).join(" "):t}});function Vt(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 Ot({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Vt(a,i,t+1/3),s=Vt(a,i,t),r=Vt(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const jt=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},Mt=[gt,ft,dt],Rt=t=>Mt.find(e=>e.test(t)),Ct=(t,e)=>{let n=Rt(t),i=Rt(e),o=n.parse(t),s=i.parse(e);n===dt&&(o=Ot(o),n=ft),i===dt&&(s=Ot(s),i=ft);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=jt(o[e],s[e],t));return r.alpha=G(o.alpha,s.alpha,t),n.transform(r)}},Lt=t=>"number"==typeof t,Dt=(t,e)=>n=>e(t(n)),kt=(...t)=>t.reduce(Dt);function Ft(t,e){return Lt(t)?n=>G(t,e,n):vt.test(t)?Ct(t,e):Nt(t,e)}const Bt=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Ft(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},Ut=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Ft(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function It(t){const e=wt.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const Nt=(t,e)=>{const n=wt.createTransformer(e),i=It(t),o=It(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?kt(Bt(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},$t=(t,e)=>n=>G(t,e,n);function zt(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?$t:"string"==typeof s?vt.test(s)?Ct:Nt:Array.isArray(s)?Bt:"object"==typeof s?Ut:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=kt(t,s)}i.push(s)}return i}function Yt(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=zt(e,i,o),a=2===s?function([t,e],[n]){return i=>n(W(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=W(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(U(t[0],t[s-1],e)):a}const Xt=t=>e=>1-t(1-e),Ht=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Wt=t=>e=>e*e*((t+1)*e-t),Gt=t=>t,qt=(Zt=2,t=>Math.pow(t,Zt));var Zt;const Kt=Xt(qt),_t=Ht(qt),Jt=t=>1-Math.sin(Math.acos(t)),Qt=Xt(Jt),te=Ht(Qt),ee=Wt(1.525),ne=Xt(ee),ie=Ht(ee),oe=(t=>{const e=Wt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),se=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},re=Xt(se);function ae(t,e){return t.map(()=>e||_t).splice(0,t.length-1)}function le({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return Yt(a,r,{ease:Array.isArray(n)?n:ae(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const ue={keyframes:le,spring:X,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function ce(t,e,n=0){return t-e-n}const he=t=>{const e=({delta:e})=>t(e);return{start:()=>P.update(e,!0),stop:()=>w.update(e)}};function de(t){var e,n,{from:i,autoplay:o=!0,driver:s=he,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=B(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:b}=f,x=0,P=f.duration,w=!1,A=!0;const T=function(t){if(Array.isArray(t.to))return le;if(ue[t.type])return ue[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?le:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?X:le}(f);(null===(n=(e=T).needsInterpolation)||void 0===n?void 0:n.call(e,i,b))&&(y=Yt([0,100],[i,b],{clamp:!1}),i=0,b=100);const E=T(Object.assign(Object.assign({},f),{from:i,to:b}));function S(){x++,"reverse"===l?(A=x%2==0,r=function(t,e,n=0,i=!0){return i?ce(e+-t,e,n):e-(t-e)+n}(r,P,u,A)):(r=ce(r,P,u),"mirror"===l&&E.flipTarget()),w=!1,p&&p()}function V(t){if(A||(t=-t),r+=t,!w){const t=E.next(Math.max(0,r));v=t.value,y&&(v=y(v)),w=A?t.done:r<=0}null==m||m(v),w&&(0===x&&(null!=P||(P=r)),x<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,A)&&S():(g.stop(),d&&d()))}return o&&(null==c||c(),g=s(V),g.start()),{stop:()=>{null==h||h(),g.stop()}}}function pe(t,e){return e?t*(1e3/e):0}const me=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),fe=t=>me(t)&&t.hasOwnProperty("z"),ge=(t,e)=>Math.abs(t-e);function ve(t,e){if(Lt(t)&&Lt(e))return ge(t,e);if(me(t)&&me(e)){const n=ge(t.x,e.x),i=ge(t.y,e.y),o=fe(t)&&fe(e)?ge(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const ye=(t,e)=>1-3*e+3*t,be=(t,e)=>3*e-6*t,xe=t=>3*t,Pe=(t,e,n)=>((ye(e,n)*t+be(e,n))*t+xe(e))*t,we=(t,e,n)=>3*ye(e,n)*t*t+2*be(e,n)*t+xe(e);function Ae(t,e,n,i){if(t===e&&n===i)return Gt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Pe(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=we(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=we(e,n,i);if(0===o)return e;e-=(Pe(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Pe(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Pe(s(t),e,i)}class Te{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Ve(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=ve(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=V();this.history.push(Object.assign(Object.assign({},i),{timestamp:o}));const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Ee(e,this.transformPagePoint),r(t)&&0===t.buttons?this.handlePointerUp(t,e):P.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=Ve(Ee(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},a(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=Ee(h(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=V();this.history=[Object.assign(Object.assign({},o),{timestamp:s})];const{onSessionStart:l}=e;l&&l(t,Ve(i,this.history)),this.removeListeners=kt(k(window,"pointermove",this.handlePointerMove),k(window,"pointerup",this.handlePointerUp),k(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),w.update(this.updatePoint)}}function Ee(t,e){return e?{point:e(t.point)}:t}function Se(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ve({point:t},e){return{point:t,delta:Se(t,je(e)),offset:Se(t,Oe(e)),velocity:Me(e,.1)}}function Oe(t){return t[0]}function je(t){return t[t.length-1]}function Me(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=je(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>O(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Re(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Ce=Re("dragHorizontal"),Le=Re("dragVertical");function De(t){let e=!1;if("y"===t)e=Le();else if("x"===t)e=Ce();else{const t=Ce(),n=Le();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function ke(){const t=De(!0);return!t||(t(),!1)}function Fe(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Be(t){return t.max-t.min}function Ue(t,e=0,n=.01){return ve(t,e)<n}function Ie(t,e,n,i=.5){t.origin=i,t.originPoint=G(e.min,e.max,t.origin),t.scale=Be(n)/Be(e),(Ue(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=G(n.min,n.max,t.origin)-t.originPoint,(Ue(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ne(t,e,n,i){Ie(t.x,e.x,n.x,null==i?void 0:i.originX),Ie(t.y,e.y,n.y,null==i?void 0:i.originY)}function $e(t,e,n){t.min=n.min+e.min,t.max=t.min+Be(e)}function ze(t,e,n){t.min=e.min-n.min,t.max=t.min+Be(e)}function Ye(t,e,n){ze(t.x,e.x,n.x),ze(t.y,e.y,n.y)}function Xe(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 He(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 We=.35;function Ge(t,e,n){return{min:qe(t,e),max:qe(t,n)}}function qe(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var Ze;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Ze||(Ze={}));function Ke(t){return[t("x"),t("y")]}function _e({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Je(t){return void 0===t||1===t}function Qe({scale:t,scaleX:e,scaleY:n}){return!Je(t)||!Je(e)||!Je(n)}function tn(t){return Qe(t)||en(t.x)||en(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function en(t){return t&&"0%"!==t}function nn(t,e,n){return n+e*(t-n)}function on(t,e,n,i,o){return void 0!==o&&(t=nn(t,o,i)),nn(t,n,i)+e}function sn(t,e=0,n=1,i,o){t.min=on(t.min,e,n,i,o),t.max=on(t.max,e,n,i,o)}function rn(t,{x:e,y:n}){sn(t.x,e.translate,e.scale,e.originPoint),sn(t.y,n.translate,n.scale,n.originPoint)}function an(t,e){t.min=t.min+e,t.max=t.max+e}function ln(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=G(t.min,t.max,s);sn(t,e[n],e[i],r,e.scale)}const un=["x","scaleX","originX"],cn=["y","scaleY","originY"];function hn(t,e){ln(t.x,e,un),ln(t.y,e,cn)}function dn(t,e){return _e(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 pn={linear:Gt,easeIn:qt,easeInOut:_t,easeOut:Kt,circIn:Jt,circInOut:te,circOut:Qt,backIn:ee,backInOut:ie,backOut:ne,anticipate:oe,bounceIn:re,bounceInOut:t=>t<.5?.5*(1-se(1-2*t)):.5*se(2*t-1)+.5,bounceOut:se},mn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Ae(e,n,i,o)}return"string"==typeof t?pn[t]:t},fn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!wt.test(e)||e.startsWith("url("))),gn=t=>Array.isArray(t),vn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),yn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),bn=()=>({type:"keyframes",ease:"linear",duration:.3}),xn=t=>({type:"keyframes",duration:.8,values:t}),Pn={x:vn,y:vn,z:vn,rotate:vn,rotateX:vn,rotateY:vn,rotateZ:vn,scaleX:yn,scaleY:yn,scale:yn,opacity:bn,backgroundColor:bn,color:bn,default:yn},wn=Object.assign(Object.assign({},tt),{transform:Math.round}),An={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:et,originX:ut,originY:ut,originZ:rt,zIndex:wn,fillOpacity:et,strokeOpacity:et,numOctaves:wn},Tn=Object.assign(Object.assign({},An),{color:vt,backgroundColor:vt,outlineColor:vt,fill:vt,stroke:vt,borderColor:vt,borderTopColor:vt,borderRightColor:vt,borderBottomColor:vt,borderLeftColor:vt,filter:St,WebkitFilter:St}),En=t=>Tn[t];function Sn(t,e){var n;let i=En(t);return i!==St&&(i=wt),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const Vn=!1,On=t=>gn(t)?t[t.length-1]||0:t;function jn(t){var{ease:e,times:n,yoyo:i,flip:o,loop:s}=t,r=B(t,["ease","times","yoyo","flip","loop"]);const a=Object.assign({},r);return n&&(a.offset=n),r.duration&&(a.duration=O(r.duration)),r.repeatDelay&&(a.repeatDelay=O(r.repeatDelay)),e&&(a.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(mn):mn(e)),"tween"===r.type&&(a.type="keyframes"),(i||s||o)&&(i?a.repeatType="reverse":s?a.repeatType="loop":o&&(a.repeatType="mirror"),a.repeat=s||i||o||r.repeat),"spring"!==r.type&&(a.type="keyframes"),a}function Mn(t,e,n){var i;return Array.isArray(e.to)&&(null!==(i=t.duration)&&void 0!==i||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function(t){var e=B(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object.assign(Object.assign({},t),((t,e)=>{let n;return n=gn(e)?xn:Pn[t]||Pn.default,Object.assign({to:e},n(e))})(n,e.to))),Object.assign(Object.assign({},e),jn(t))}function Rn(t,e,n,i,o){var s;const r=Dn(i,t);let a=null!==(s=r.from)&&void 0!==s?s:e.get();const l=fn(t,n);"none"===a&&l&&"string"==typeof n?a=Sn(t,n):Cn(a)&&"string"==typeof n?a=Ln(n):!Array.isArray(n)&&Cn(n)&&"string"==typeof a&&(n=Ln(a));return fn(t,a)&&l&&!1!==r.type?function(){const i={from:a,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function g(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function v(t){null==m||m.stop(),m=de(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:g(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=g(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=pe(t-c,V().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(Object.assign(Object.assign({},i),r)):de(Object.assign(Object.assign({},Mn(r,i,t)),{onUpdate:t=>{var e;i.onUpdate(t),null===(e=r.onUpdate)||void 0===e||e.call(r,t)},onComplete:()=>{var t;i.onComplete(),null===(t=r.onComplete)||void 0===t||t.call(r)}}))}:function(){var t,i;const s=On(n);return e.set(s),o(),null===(t=null==r?void 0:r.onUpdate)||void 0===t||t.call(r,s),null===(i=null==r?void 0:r.onComplete)||void 0===i||i.call(r),{stop:()=>{}}}}function Cn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Ln(t){return"number"==typeof t?0:Sn("",t)}function Dn(t,e){return t[e]||t.default||t}function kn(t,e,n,i={}){return Vn&&(i={type:!1}),e.start(o=>{let s,r;const a=Rn(t,e,n,i,o),l=function(t,e){var n,i;return null!==(i=null!==(n=(Dn(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),u=()=>r=a();return l?s=window.setTimeout(u,O(l)):u(),()=>{clearTimeout(s),null==r||r.stop()}})}const Fn=new WeakMap;class Bn{constructor(t){this.openGlobalLock=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}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Te(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(h(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=De(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ke(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(st.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=Be(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Ze.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)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&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Ze.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Un(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?G(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?G(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&Fe(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:Xe(t.x,n,o),y:Xe(t.y,e,i)}}(n.actual,t),this.elastic=function(t=We){return!1===t?t=0:!0===t&&(t=We),{x:Ge(t,"left","right"),y:Ge(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ke(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Fe(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=dn(t,n),{scroll:o}=e;return o&&(an(i.x,o.x),an(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:He(t.x,e.x),y:He(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=_e(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Ke(r=>{var l;if(!Un(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d=Object.assign(Object.assign({type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},o),u);return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return kn(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Ke(e=>{const{drag:n}=this.getProps();if(!Un(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-G(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Fe(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ke(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=Be(t),o=Be(e);return o>i?n=W(e.min,e.max-i,t.min):i>o&&(n=W(t.min,t.max-o,e.min)),U(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Ke(t=>{if(!Un(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(G(i,s,o[t]))})}addListeners(){var t;Fn.set(this.visualElement,this);const e=k(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();Fe(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=j(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ke(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=We,dragMomentum:r=!0}=t;return Object.assign(Object.assign({},t),{drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r})}}function Un(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const In=i({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Nn(t){return e(()=>()=>t(),[])}const $n=t=>e=>(t(e),null),zn={pan:$n((function({onPan:t,onPanStart:i,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||i||s||r,u=n(null),{transformPagePoint:c}=o(In),h={onSessionStart:r,onStart:i,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),F(a,"pointerdown",l&&function(t){u.current=new Te(t,h,{transformPagePoint:c})}),Nn(()=>u.current&&u.current.end())})),drag:$n((function(t){const{dragControls:i,visualElement:o}=t,s=function(t){const e=n(null);return null===e.current&&(e.current=t()),e.current}(()=>new Bn(o));e(()=>i&&i.subscribe(s),[s,i]),e(()=>s.addListeners(),[s])}))},Yn=i(null);function Xn(){const t=o(Yn);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,a=s();e(()=>r(a),[]);return!n&&i?[!1,()=>null==i?void 0:i(a)]:[!0]}const Hn=i({}),Wn=i({}),Gn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Zn={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${qn(t,e.target.x)}% ${qn(t,e.target.y)}%`}};function Kn(t){return"string"==typeof t&&t.startsWith("var(--")}const _n=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Jn(t,e,n=1){const[i,o]=function(t){const e=_n.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():Kn(o)?Jn(o,e,n+1):o}const Qn={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(_n,t=>(s.push(t),"_$css")));const r=wt.parse(t);if(r.length>5)return i;const a=wt.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=G(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}},ti={};class ei extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;var s;s=ni,Object.assign(ti,s),o&&((null==e?void 0:e.group)&&e.group.add(o),(null==n?void 0:n.register)&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions(Object.assign(Object.assign({},o.options),{onExitComplete:()=>this.safeToRemove()}))),Gn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||P.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const ni={borderRadius:Object.assign(Object.assign({},Zn),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Zn,borderTopRightRadius:Zn,borderBottomLeftRadius:Zn,borderBottomRightRadius:Zn,boxShadow:Qn},ii={measureLayout:function(e){const[n,i]=Xn(),s=o(Hn);return t.createElement(ei,Object.assign({},e,{layoutGroup:s,switchLayoutGroup:o(Wn),isPresent:n,safeToRemove:i}))}};function oi(t,e){-1===t.indexOf(e)&&t.push(e)}function si(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ri{constructor(){this.subscriptions=[]}add(t){return oi(this.subscriptions,t),()=>si(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class ai{constructor(t){var e;this.version="7.2.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new ri,this.velocityUpdateSubscribers=new ri,this.renderSubscribers=new ri,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=V();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,P.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>P.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?pe(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function li(t){return new ai(t)}const ui=t=>Boolean(null!==t&&"object"==typeof t&&t.getVelocity);const ci=["TopLeft","TopRight","BottomLeft","BottomRight"],hi=ci.length,di=t=>"string"==typeof t?parseFloat(t):t,pi=t=>"number"==typeof t||rt.test(t);function mi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const fi=vi(0,.5,Qt),gi=vi(.5,.95,Gt);function vi(t,e,n){return i=>i<t?0:i>e?1:n(W(t,e,i))}function yi(t,e){t.min=e.min,t.max=e.max}function bi(t,e){yi(t.x,e.x),yi(t.y,e.y)}function xi(t,e,n,i,o){return t=nn(t-=e,1/n,i),void 0!==o&&(t=nn(t,1/o,i)),t}function Pi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(st.test(e)){e=parseFloat(e);e=G(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=G(s.min,s.max,i);t===s&&(a-=e),t.min=xi(t.min,e,n,a,o),t.max=xi(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const wi=["x","scaleX","originX"],Ai=["y","scaleY","originY"];function Ti(t,e,n,i){Pi(t.x,e,wi,null==n?void 0:n.x,null==i?void 0:i.x),Pi(t.y,e,Ai,null==n?void 0:n.y,null==i?void 0:i.y)}function Ei(t){return 0===t.translate&&1===t.scale}function Si(t){return Ei(t.x)&&Ei(t.y)}function Vi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}class Oi{constructor(){this.members=[]}add(t){oi(this.members,t),t.scheduleRender()}remove(t){if(si(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){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ji(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const Mi=["","X","Y","Z"],Ri=["transformPerspective","x","y","z"];function Ci(t,e){return Ri.indexOf(t)-Ri.indexOf(e)}["translate","scale","rotate","skew"].forEach(t=>Mi.forEach(e=>Ri.push(t+e)));const Li=new Set(Ri);function Di(t){return Li.has(t)}const ki=new Set(["originX","originY","originZ"]);function Fi(t){return ki.has(t)}const Bi=(t,e)=>t.depth-e.depth;class Ui{constructor(){this.children=[],this.isDirty=!1}add(t){oi(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Bi),this.isDirty=!1,this.children.forEach(t)}}function Ii(t){const e=ui(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}function Ni({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Gi),this.nodes.forEach(qi)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ui)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ri),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(i,250),Gn.hasAnimatedSinceResize&&(Gn.hasAnimatedSinceResize=!1,this.nodes.forEach(Wi))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:to,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Vi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e=Object.assign(Object.assign({},Dn(c,"layout")),{onPlay:h,onComplete:d});r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,w.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(Zi))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!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()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Xi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(eo),this.potentialNodes.clear()),this.nodes.forEach(Hi),this.nodes.forEach($i),this.nodes.forEach(zi),this.clearAllSnapshots(),A.update(),A.preRender(),A.render())}clearAllSnapshots(){this.nodes.forEach(Yi),this.sharedNodes.forEach(Ki)}scheduleUpdateProjection(){P.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){P.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));io(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;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 e=this.measure();io(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Si(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||tn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(an(e.x,n.x),an(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};bi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){bi(e,t);const{scroll:n}=this.root;n&&(an(e.x,-n.x),an(e.y,-n.y))}an(e.x,o.x),an(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};bi(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&&hn(n,{x:-i.scroll.x,y:-i.scroll.y}),tn(i.latestValues)&&hn(n,i.latestValues)}return tn(this.latestValues)&&hn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};bi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!tn(i.latestValues))continue;Qe(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};bi(o,i.measure()),Ti(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return tn(this.latestValues)&&Ti(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}setOptions(t){var e;this.options=Object.assign(Object.assign(Object.assign({},this.options),t),{crossfade:null===(e=t.crossfade)||void 0===e||e})}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}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ye(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),bi(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,$e(i.x,o.x,s.x),$e(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):bi(this.target,this.layout.actual),rn(this.target,this.targetDelta)):bi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ye(this.relativeTargetOrigin,this.target,this.relativeParent.target),bi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!tn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();bi(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&hn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,rn(t,l)),i&&tn(a.latestValues)&&hn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(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}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;Ne(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=ji(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s=Object.assign({},this.latestValues),r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Qi));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var h,d,p,m;_i(r.x,t.x,i),_i(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Ye(a,this.layout.actual,this.relativeParent.layout.actual),h=this.relativeTarget,d=this.relativeTargetOrigin,p=a,m=i,Ji(h.x,d.x,p.x,m),Ji(h.y,d.y,p.y,m)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,u;o?(t.opacity=G(0,null!==(r=n.opacity)&&void 0!==r?r:1,fi(i)),t.opacityExit=G(null!==(a=e.opacity)&&void 0!==a?a:1,0,gi(i))):s&&(t.opacity=G(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,i));for(let o=0;o<hi;o++){const s=`border${ci[o]}Radius`;let r=mi(e,s),a=mi(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||pi(r)===pi(a)?(t[s]=Math.max(G(di(r),di(a),i),0),(st.test(a)||st.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=G(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(w.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=P.update(()=>{Gn.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=ui(t)?t:li(t);return kn("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,Object.assign(Object.assign({},t),{onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const{targetWithTransforms:t,target:e,layout:n,latestValues:i}=this.getLead();t&&e&&n&&(bi(t,e),hn(t,i),Ne(this.projectionDeltaWithTransform,this.layoutCorrected,t,i))}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Oi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}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)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<Mi.length;i++){const o="rotate"+Mi[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i,o,s,r;const a={};if(!this.instance||this.isSVG)return a;if(!this.isVisible)return{visibility:"hidden"};a.visibility="";const l=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Ii(t.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const e={};return this.options.layoutId&&(e.opacity=null!==(n=this.latestValues.opacity)&&void 0!==n?n:1,e.pointerEvents=Ii(t.pointerEvents)||""),this.hasProjected&&!tn(this.latestValues)&&(e.transform=l?l({},""):"none",this.hasProjected=!1),e}const c=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=ji(this.projectionDeltaWithTransform,this.treeScale,c),l&&(a.transform=l(c,a.transform));const{x:h,y:d}=this.projectionDelta;a.transformOrigin=`${100*h.origin}% ${100*d.origin}% 0`,u.animationValues?a.opacity=u===this?null!==(o=null!==(i=c.opacity)&&void 0!==i?i:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?null!==(s=c.opacity)&&void 0!==s?s:"":null!==(r=c.opacityExit)&&void 0!==r?r:0;for(const t in ti){if(void 0===c[t])continue;const{correct:e,applyTo:n}=ti[t],i=e(c[t],u);if(n){const t=n.length;for(let e=0;e<t;e++)a[n[e]]=i}else a[t]=i}return this.options.layoutId&&(a.pointerEvents=u===this?Ii(t.pointerEvents)||"":"none"),a}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(Xi),this.root.sharedNodes.clear()}}}function $i(t){t.updateLayout()}function zi(t){var e,n,i,o;const s=null!==(n=null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)&&void 0!==n?n:t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout;"size"===t.options.animationType?Ke(t=>{const n=s.isShared?s.measured[t]:s.layout[t],i=Be(n);n.min=e[t].min,n.max=n.min+i}):"position"===t.options.animationType&&Ke(t=>{const n=s.isShared?s.measured[t]:s.layout[t],i=Be(e[t]);n.max=n.min+i});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ne(i,e,s.layout);const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s.isShared?Ne(o,t.applyTransform(n,!0),s.measured):Ne(o,e,s.layout);const r=!Si(i);let a=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};Ye(t,s.layout,n.layout);const o={x:{min:0,max:0},y:{min:0,max:0}};Ye(o,e,i.actual),Vi(t,o)||(a=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:s,delta:o,layoutDelta:i,hasLayoutChanged:r,hasRelativeTargetChanged:a})}else t.isLead()&&(null===(o=(i=t.options).onExitComplete)||void 0===o||o.call(i));t.options.transition=void 0}function Yi(t){t.clearSnapshot()}function Xi(t){t.clearMeasurements()}function Hi(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function Wi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Gi(t){t.resolveTargetDelta()}function qi(t){t.calcProjection()}function Zi(t){t.resetRotation()}function Ki(t){t.removeLeadSnapshot()}function _i(t,e,n){t.translate=G(e.translate,0,n),t.scale=G(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ji(t,e,n,i){t.min=G(e.min,n.min,i),t.max=G(e.max,n.max,i)}function Qi(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const to={duration:.45,ease:[.4,0,.1,1]};function eo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function no(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function io(t){no(t.x),no(t.y)}const oo=Ni({attachResizeListener:(t,e)=>j(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),so={current:void 0},ro=Ni({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!so.current){const t=new oo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),so.current=t}return so.current},resetTransform:(t,e)=>{t.style.transform=null!=e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ao={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function lo(t){return Boolean(ui(t)&&t.add)}function uo(t){return"object"==typeof t&&"function"==typeof t.start}function co(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const ho=t=>/^0[^.\s]+$/.test(t),po=t=>e=>e.test(t),mo=[tt,rt,st,ot,lt,at,{test:t=>"auto"===t,parse:t=>t}],fo=t=>mo.find(po(t)),go=[...mo,vt,wt],vo=t=>go.find(po(t));function yo(t){return Array.isArray(t)}function bo(t){return"string"==typeof t||yo(t)}function xo(t,e,n){const i=t.getProps();return function(t,e,n,i={},o={}){var s;return"function"==typeof e&&(e=e(null!=n?n:t.custom,i,o)),"string"==typeof e&&(e=null===(s=t.variants)||void 0===s?void 0:s[e]),"function"==typeof e&&(e=e(null!=n?n:t.custom,i,o)),e}(i,e,null!=n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Po(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||bo(t.initial)||bo(t.animate)||bo(t.whileHover)||bo(t.whileDrag)||bo(t.whileTap)||bo(t.whileFocus)||bo(t.exit)}function wo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,li(n))}function Ao(t,e){if(!e)return;return(e[t]||e.default||e).from}function To(t,e,n={}){var i;const o=xo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Eo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(So).forEach((t,i)=>{r.push(To(t,e,Object.assign(Object.assign({},s),{delay:n+l(i)})).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Eo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let r=t.makeTargetAnimatable(e),{transition:a=t.getDefaultTransition(),transitionEnd:l}=r,u=B(r,["transition","transitionEnd"]);const c=t.getValue("willChange");i&&(a=i);const h=[],d=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const i=t.getValue(e),o=u[e];if(!i||void 0===o||d&&Vo(d,e))continue;let s=Object.assign({delay:n},a);t.shouldReduceMotion&&Di(e)&&(s=Object.assign(Object.assign({},s),{type:!1,delay:0}));let r=kn(e,i,o,s);lo(c)&&(c.add(e),r=r.then(()=>c.remove(e))),h.push(r)}return Promise.all(h).then(()=>{l&&function(t,e){const n=xo(t,e);let i=n?t.makeTargetAnimatable(n,!1):{},{transitionEnd:o={},transition:s={}}=i,r=B(i,["transitionEnd","transition"]);r=Object.assign(Object.assign({},r),o);for(const e in r){wo(t,e,On(r[e]))}}(t,l)})}function So(t,e){return t.sortNodePosition(e)}function Vo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Oo=[Ze.Animate,Ze.InView,Ze.Focus,Ze.Hover,Ze.Tap,Ze.Drag,Ze.Exit],jo=[...Oo].reverse(),Mo=Oo.length;function Ro(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>To(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=To(t,e,n);else{const o="function"==typeof e?xo(t,e,n.custom):e;i=Eo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function Co(t){let e=Ro(t);const n={[Ze.Animate]:Do(!0),[Ze.InView]:Do(),[Ze.Hover]:Do(),[Ze.Tap]:Do(),[Ze.Drag]:Do(),[Ze.Focus]:Do(),[Ze.Exit]:Do()};let i=!0;const o=(e,n)=>{const i=xo(t,n);if(i){const{transition:t,transitionEnd:n}=i,o=B(i,["transition","transitionEnd"]);e=Object.assign(Object.assign(Object.assign({},e),o),n)}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<Mo;e++){const m=jo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],v=bo(g),y=m===r?f.isActive:null;!1===y&&(p=e);let b=g===u[m]&&g!==l[m]&&v;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys=Object.assign({},d),!f.isActive&&null===y||!g&&!f.prevProp||uo(g)||"boolean"==typeof g)continue;const x=Lo(f.prevProp,g);let P=x||m===r&&f.isActive&&!b&&v||e>p&&v;const w=Array.isArray(g)?g:[g];let A=w.reduce(o,{});!1===y&&(A={});const{prevResolvedValues:T={}}=f,E=Object.assign(Object.assign({},T),A),S=t=>{P=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=A[t],n=T[t];d.hasOwnProperty(t)||(e!==n?gn(e)&&gn(n)?!co(e,n)||x?S(t):f.protectedKeys[t]=!0:void 0!==e?S(t):h.add(t):void 0!==e&&h.has(t)?S(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=A,f.isActive&&(d=Object.assign(Object.assign({},d),A)),i&&t.blockInitialAnimation&&(P=!1),P&&!b&&c.push(...w.map(t=>({animation:t,options:Object.assign({type:m},s)})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Lo(t,e){return"string"==typeof e?e!==t:!!yo(e)&&!co(e,t)}function Do(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const ko=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const Fo=new Set;const Bo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:s,readValueFromInstance:r,removeValueFromRenderState:a,sortNodePosition:l,scrapeMotionValuesFromProps:u})=>({parent:c,props:h,presenceId:d,blockInitialAnimation:p,visualState:m,shouldReduceMotion:f},g={})=>{let v=!1;const{latestValues:y,renderState:b}=m;let x;const A=function(){const t=ko.map(()=>new ri),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ko.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+ko[e]]=e=>t.add(e),n["notify"+ko[e]]=(...e)=>t.notify(...e)}),n}(),T=new Map,E=new Map;let S={};const V=Object.assign({},y);let O;function j(){x&&v&&(M(),s(x,b,h.style,I.projection))}function M(){e(I,b,y,g,h)}function R(){A.notifyUpdate(y)}function C(t,e){const n=e.onChange(e=>{y[t]=e,h.onUpdate&&P.update(R,!1,!0)}),i=e.onRenderRequest(I.scheduleRender);E.set(t,()=>{n(),i()})}const L=u(h),{willChange:D}=L,k=B(L,["willChange"]);for(const t in k){const e=k[t];void 0!==y[t]&&ui(e)&&(e.set(y[t],!1),lo(D)&&D.add(t))}const F=Po(h),U=function(t){return Boolean(Po(t)||t.variants)}(h),I=Object.assign(Object.assign({treeType:t,current:null,depth:c?c.depth+1:0,parent:c,children:new Set,presenceId:d,shouldReduceMotion:f,variantChildren:U?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==c?void 0:c.isMounted()),blockInitialAnimation:p,isMounted:()=>Boolean(x),mount(t){v=!0,x=I.current=t,I.projection&&I.projection.mount(t),U&&c&&!F&&(O=null==c?void 0:c.addVariantChild(I)),T.forEach((t,e)=>C(e,t)),null==c||c.children.add(I),I.setProps(h)},unmount(){var t;null===(t=I.projection)||void 0===t||t.unmount(),w.update(R),w.render(j),E.forEach(t=>t()),null==O||O(),null==c||c.children.delete(I),A.clearAllListeners(),x=void 0,v=!1},addVariantChild(t){var e;const n=I.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>l&&t===e.treeType?l(I.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>U?I:null==c?void 0:c.getClosestVariantNode(),getLayoutId:()=>h.layoutId,getInstance:()=>x,getStaticValue:t=>y[t],setStaticValue:(t,e)=>y[t]=e,getLatestValues:()=>y,setVisibility(t){I.isVisible!==t&&(I.isVisible=t,I.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(I,t,h,e),measureViewportBox:()=>o(x,h),addValue(t,e){I.hasValue(t)&&I.removeValue(t),T.set(t,e),y[t]=e.get(),C(t,e)},removeValue(t){var e;T.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete y[t],a(t,b)},hasValue:t=>T.has(t),getValue(t,e){let n=T.get(t);return void 0===n&&void 0!==e&&(n=li(e),I.addValue(t,n)),n},forEachValue:t=>T.forEach(t),readValue:t=>{var e;return null!==(e=y[t])&&void 0!==e?e:r(x,t,g)},setBaseTarget(t,e){V[t]=e},getBaseTarget(t){if(n){const e=n(h,t);if(void 0!==e&&!ui(e))return e}return V[t]}},A),{build:()=>(M(),b),scheduleRender(){P.render(j,!1,!0)},syncRender:j,setProps(t){(t.transformTemplate||h.transformTemplate)&&I.scheduleRender(),h=t,A.updatePropListeners(t),S=function(t,e,n){var i;const{willChange:o}=e;for(const s in e){const r=e[s],a=n[s];if(ui(r))t.addValue(s,r),lo(o)&&o.add(s);else if(ui(a))t.addValue(s,li(r)),lo(o)&&o.remove(s);else if(a!==r)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(r)}else t.addValue(s,li(null!==(i=t.getStaticValue(s))&&void 0!==i?i:r))}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(I,u(h),S)},getProps:()=>h,getVariant:t=>{var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>h.transition,getTransformPagePoint:()=>h.transformPagePoint,getVariantContext(t=!1){if(t)return null==c?void 0:c.getVariantContext();if(!F){const t=(null==c?void 0:c.getVariantContext())||{};return void 0!==h.initial&&(t.initial=h.initial),t}const e={};for(let t=0;t<Io;t++){const n=Uo[t],i=h[n];(bo(i)||!1===i)&&(e[n]=i)}return e}});return I},Uo=["initial",...Oo],Io=Uo.length;function No(t){return t.startsWith("--")}const $o=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function zo(t,e,n,i){var o;const{style:s,vars:r,transform:a,transformKeys:l,transformOrigin:u}=t;l.length=0;let c=!1,h=!1,d=!0;for(const t in e){const n=e[t];if(No(t)){r[t]=n;continue}const i=An[t],p=$o(n,i);if(Di(t)){if(c=!0,a[t]=p,l.push(t),!d)continue;n!==(null!==(o=i.default)&&void 0!==o?o:0)&&(d=!1)}else Fi(t)?(u[t]=p,h=!0):s[t]=p}c?s.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:i=!0},o,s){let r="";e.sort(Ci);let a=!1;const l=e.length;for(let n=0;n<l;n++){const i=e[n];r+=`${ao[i]||i}(${t[i]}) `,"z"===i&&(a=!0)}return!a&&n&&(r+="translateZ(0)"),r=r.trim(),s?r=s(t,o?"":r):i&&o&&(r="none"),r}(t,n,d,i):i?s.transform=i({},""):!e.transform&&s.transform&&(s.transform="none"),h&&(s.transformOrigin=function({originX:t="50%",originY:e="50%",originZ:n=0}){return`${t} ${e} ${n}`}(u))}const Yo=new Set(["width","height","top","left","right","bottom","x","y"]),Xo=t=>Yo.has(t),Ho=(t,e)=>{t.set(e,!1),t.set(e)},Wo=t=>t===tt||t===rt;var Go;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Go||(Go={}));const qo=(t,e)=>parseFloat(t.split(", ")[e]),Zo=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return qo(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?qo(e[1],t):0}},Ko=new Set(["x","y","z"]),_o=Ri.filter(t=>!Ko.has(t));const Jo={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:Zo(4,13),y:Zo(5,14)},Qo=(t,e,n={},i={})=>{e=Object.assign({},e),i=Object.assign({},i);const o=Object.keys(e).filter(Xo);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=fo(u);const h=e[o];let d;if(gn(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=fo(u);for(let n=e;n<t;n++)d?fo(h[n]):d=fo(h[n])}else d=fo(h);if(c!==d)if(Wo(c)&&Wo(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return _o.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],Ho(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Jo[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);Ho(i,a[n]),t[n]=Jo[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),R&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function ts(t,e,n,i){return(t=>Object.keys(t).some(Xo))(e)?Qo(t,e,n,i):{target:e,transitionEnd:i}}const es=(t,e,n,i)=>{const o=function(t,e,n){var i,o=B(e,[]);const s=t.getInstance();if(!(s instanceof Element))return{target:o,transitionEnd:n};n&&(n=Object.assign({},n)),t.forEachValue(t=>{const e=t.get();if(!Kn(e))return;const n=Jn(e,s);n&&t.set(n)});for(const t in o){const e=o[t];if(!Kn(e))continue;const r=Jn(e,s);r&&(o[t]=r,n&&(null!==(i=n[t])&&void 0!==i||(n[t]=e)))}return{target:o,transitionEnd:n}}(t,e,i);return ts(t,e=o.target,n,i=o.transitionEnd)};function ns(t,{layout:e,layoutId:n}){return Di(t)||Fi(t)||(e||void 0!==n)&&(!!ti[t]||"opacity"===t)}function is(t){const{style:e}=t,n={};for(const i in e)(ui(e[i])||ns(i,t))&&(n[i]=e[i]);return n}function os(t,{style:e,vars:n},i,o){Object.assign(t.style,e,o&&o.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}const ss={treeType:"dom",readValueFromInstance(t,e){if(Di(e)){const t=En(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=(No(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>dn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,e,n,i){var{transition:o,transitionEnd:s}=e,r=B(e,["transition","transitionEnd"]),a=n.transformValues;void 0===i&&(i=!0);let l=function(t,e,n){var i,o;const s={};for(const r in t)s[r]=null!==(i=Ao(r,e))&&void 0!==i?i:null===(o=n.getValue(r))||void 0===o?void 0:o.get();return s}(r,o||{},t);if(a&&(s&&(s=a(s)),r&&(r=a(r)),l&&(l=a(l))),i){!function(t,e,n){var i,o,s,r;const a=Object.keys(e).filter(e=>!t.hasValue(e)),l=a.length;if(l)for(let u=0;u<l;u++){const l=a[u],c=e[l];let h=null;Array.isArray(c)&&(h=c[0]),null===h&&(h=null!==(o=null!==(i=n[l])&&void 0!==i?i:t.readValue(l))&&void 0!==o?o:e[l]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||ho(h))?h=parseFloat(h):!vo(h)&&wt.test(c)&&(h=Sn(l,c)),t.addValue(l,li(h)),null!==(s=(r=n)[l])&&void 0!==s||(r[l]=h),t.setBaseTarget(l,h))}}(t,r,l);const e=es(t,r,l,s);s=e.transitionEnd,r=e.target}return Object.assign({transition:o,transitionEnd:s},r)},scrapeMotionValuesFromProps:is,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),zo(e,n,i,o.transformTemplate)},render:os},rs=Bo(ss),as={animation:$n(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Co(t)),uo(n)&&e(()=>n.subscribe(t),[n])}),exit:$n(t=>{const{custom:n,visualElement:i}=t,[s,r]=Xn(),a=o(Yn);e(()=>{var t,e;i.isPresent=s;const o=null===(t=i.animationState)||void 0===t?void 0:t.setActive(Ze.Exit,!s,{custom:null!==(e=null==a?void 0:a.custom)&&void 0!==e?e:n});!s&&(null==o||o.then(r))},[s])})};function ls(t,e,n){return(i,o)=>{var s;r(i)&&!ke()&&(null===(s=t.animationState)||void 0===s||s.setActive(Ze.Hover,e),null==n||n(i,o))}}const us=(t,e)=>!!e&&(t===e||us(t,e.parentElement));const cs=("undefined"==typeof process||process.env,"production"),hs=new WeakMap,ds=new WeakMap,ps=t=>{var e;null===(e=hs.get(t.target))||void 0===e||e(t)},ms=t=>{t.forEach(ps)};function fs(t,e,n){const i=function(t){var{root:e}=t,n=B(t,["root"]);const i=e||document;ds.has(i)||ds.set(i,{});const o=ds.get(i),s=JSON.stringify(n);return o[s]||(o[s]=new IntersectionObserver(ms,Object.assign({root:e},n))),o[s]}(e);return hs.set(t,n),i.observe(t),()=>{hs.delete(t),i.unobserve(t)}}const gs={some:0,all:1};function vs(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:gs[r]};return fs(i.getInstance(),e,t=>{var e;const{isIntersecting:o}=t;if(n.isInView===o)return;if(n.isInView=o,a&&!o&&n.hasEnteredView)return;o&&(n.hasEnteredView=!0),null===(e=i.animationState)||void 0===e||e.setActive(Ze.InView,o);const s=i.getProps(),r=o?s.onViewportEnter:s.onViewportLeave;null==r||r(t)})},[t,o,s,r])}function ys(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==cs&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Fo.has(e)||(console.warn(e),s&&console.warn(s),Fo.add(e))),requestAnimationFrame(()=>{var t;n.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();null==e||e(null),null===(t=i.animationState)||void 0===t||t.setActive(Ze.InView,!0)}))},[t])}const bs={inView:$n((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ys:vs)(a,r.current,t,s)})),tap:$n((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function h(){var t;return c(),a.current=!1,null===(t=s.animationState)||void 0===t||t.setActive(Ze.Tap,!1),!ke()}function d(e,n){h()&&(us(s.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function p(t,e){h()&&(null==i||i(t,e))}function m(t,n){var i;c(),a.current||(a.current=!0,l.current=kt(k(window,"pointerup",d,u),k(window,"pointercancel",p,u)),null===(i=s.animationState)||void 0===i||i.setActive(Ze.Tap,!0),null==e||e(t,n))}F(s,"pointerdown",r?m:void 0,u),Nn(c)})),focus:$n((function({whileFocus:t,visualElement:e}){M(e,"focus",t?()=>{var t;null===(t=e.animationState)||void 0===t||t.setActive(Ze.Focus,!0)}:void 0),M(e,"blur",t?()=>{var t;null===(t=e.animationState)||void 0===t||t.setActive(Ze.Focus,!1)}:void 0)})),hover:$n((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){F(i,"pointerenter",t||n?ls(i,!0,t):void 0,{passive:!t}),F(i,"pointerleave",e||n?ls(i,!1,e):void 0,{passive:!e})}))};function xs(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ps={offset:"stroke-dashoffset",array:"stroke-dasharray"},ws={offset:"strokeDashoffset",array:"strokeDasharray"};function As(t,e,n,i){var{attrX:o,attrY:s,originX:r,originY:a,pathLength:l,pathSpacing:u=1,pathOffset:c=0}=e;zo(t,B(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i),t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(void 0!==r||void 0!==a||d.transform)&&(d.transformOrigin=function(t,e,n){return`${xs(e,t.x,t.width)} ${xs(n,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==a?a:.5)),void 0!==o&&(h.x=o),void 0!==s&&(h.y=s),void 0!==l&&function(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Ps:ws;t[s.offset]=rt.transform(-i);const r=rt.transform(e),a=rt.transform(n);t[s.array]=`${r} ${a}`}(h,l,u,c,!1)}const Ts=/([a-z])([A-Z])/g,Es=t=>t.replace(Ts,"$1-$2").toLowerCase(),Ss=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);const Vs=Bo(Object.assign(Object.assign({},ss),{getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return Di(e)?(null===(n=En(e))||void 0===n?void 0:n.default)||0:(e=Ss.has(e)?e:Es(e),t.getAttribute(e))},scrapeMotionValuesFromProps:function(t){const e=is(t);for(const n in t)if(ui(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e},build(t,e,n,i,o){As(e,n,i,o.transformTemplate)},render:function(t,e,n,i){os(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ss.has(n)?n:Es(n),e.attrs[n])}})),Os=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];const js=Object.assign(Object.assign({renderer:(t,e)=>function(t){return"string"==typeof t&&!t.includes("-")&&!!(Os.indexOf(t)>-1||/[A-Z]/.test(t))}(t)?Vs(e,{enableHardwareAcceleration:!1}):rs(e,{enableHardwareAcceleration:!0})},as),bs),Ms=Object.assign(Object.assign(Object.assign(Object.assign({},js),zn),ii),{projectionNodeConstructor:ro});export{Ms as domMax};
1
+ import t,{useEffect as e,useRef as n,useContext as i,useId as o,createElement as s}from"react";import{q as r,t as a,v as l,w as u,x as c,y as h,z as d,A as p,B as m,i as f,C as v,D as g,E as y,a as x,u as b,M as P,P as A,F as T,G as w,g as S,L as E,S as V,d as M,r as C,H as R,I as L,J as D,K as k,n as j,N as O,m as F,c as U,f as I,b as B,l as N,O as z,Q as $,p as G,h as H,R as W,T as Y,U as X,s as q,j as K,o as Z,k as _}from"./size-rollup-dom-max-assets.js";const J=(t,e)=>n=>Boolean(r(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Q=(t,e,n)=>i=>{if(!r(i))return i;const[o,s,a,u]=i.match(l);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==u?parseFloat(u):1}},tt={test:J("hsl","hue"),parse:Q("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+u.transform(c(e))+", "+u.transform(c(n))+", "+c(h.transform(i))+")"},et=p(0,255),nt=Object.assign(Object.assign({},d),{transform:t=>Math.round(et(t))}),it={test:J("rgb","red"),parse:Q("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+c(h.transform(i))+")"};const ot={test:J("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:it.transform},st={test:t=>it.test(t)||ot.test(t)||tt.test(t),parse:t=>it.test(t)?it.parse(t):tt.test(t)?tt.parse(t):ot.parse(t),transform:t=>r(t)?t:t.hasOwnProperty("red")?it.transform(t):tt.transform(t)};function rt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const i=t.match(m);i&&(n=i.length,t=t.replace(m,"${c}"),e.push(...i.map(st.parse)));const o=t.match(l);return o&&(t=t.replace(l,"${n}"),e.push(...o.map(d.parse))),{values:e,numColors:n,tokenised:t}}function at(t){return rt(t).values}function lt(t){const{values:e,numColors:n,tokenised:i}=rt(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?st.transform(t[i]):c(t[i]));return e}}const ut=t=>"number"==typeof t?0:t;const ct={test:function(t){var e,n,i,o;return isNaN(t)&&r(t)&&(null!==(n=null===(e=t.match(l))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(i=t.match(m))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:at,createTransformer:lt,getAnimatableNone:function(t){const e=at(t);return lt(t)(e.map(ut))}},ht=new Set(["brightness","contrast","saturate","opacity"]);function dt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(l)||[];if(!i)return t;const o=n.replace(i,"");let s=ht.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const pt=/([a-z-]*)\(.*?\)/g,mt=Object.assign(Object.assign({},ct),{getAnimatableNone:t=>{const e=t.match(pt);return e?e.map(dt).join(" "):t}});function ft(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vt(t){return!!t.touches}const gt={pageX:0,pageY:0};function yt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||gt;return{x:n[e+"X"],y:n[e+"Y"]}}function xt(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function bt(t,e="page"){return{point:vt(t)?yt(t,e):xt(t,e)}}const Pt=(t,e=!1)=>{const n=e=>t(e,bt(e));return e?(i=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&i(t)}):n;var i},At="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(At()),1/60*1e3);let wt=!0,St=!1,Et=!1;const Vt={delta:0,timestamp:0},Mt=["read","update","preRender","render","postRender"],Ct=Mt.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const l=a&&o,u=l?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(l))}}};return a}(()=>St=!0),t),{}),Rt=Mt.reduce((t,e)=>{const n=Ct[e];return t[e]=(t,e=!1,i=!1)=>(St||Ot(),n.schedule(t,e,i)),t},{}),Lt=Mt.reduce((t,e)=>(t[e]=Ct[e].cancel,t),{}),Dt=Mt.reduce((t,e)=>(t[e]=()=>Ct[e].process(Vt),t),{}),kt=t=>Ct[t].process(Vt),jt=t=>{St=!1,Vt.delta=wt?1/60*1e3:Math.max(Math.min(t-Vt.timestamp,40),1),Vt.timestamp=t,Et=!0,Mt.forEach(kt),Et=!1,St&&(wt=!1,Tt(jt))},Ot=()=>{St=!0,wt=!0,Et||Tt(jt)},Ft=()=>Vt,Ut=t=>1e3*t;function It(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Bt(t,n,i,o){e(()=>{const e=t.current;if(i&&e)return It(e,n,i,o)},[t,n,i,o])}const Nt={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},zt={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function $t(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?zt[t]:f&&null===window.onmousedown?Nt[t]:t}function Gt(t,e,n,i){return It(t,$t(e),Pt(n,"pointerdown"===e),i)}function Ht(t,e,n,i){return Bt(t,$t(e),n&&Pt(n,"pointerdown"===e),i)}function Wt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}const Yt=(t,e,n)=>Math.min(Math.max(n,t),e);function Xt({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=Yt(.05,1,r),t=Yt(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/qt(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=qt(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=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}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function qt(t,e){return t*Math.sqrt(1-e*e)}const Kt=["duration","bounce"],Zt=["stiffness","damping","mass"];function _t(t,e){return e.some(e=>void 0!==t[e])}function Jt(t){var{from:e=0,to:n=1,restSpeed:i=2,restDelta:o}=t,s=Wt(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!_t(t,Zt)&&_t(t,Kt)){const n=Xt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),p=Qt,m=Qt;function f(){const t=c?-c/1e3:0,i=n-e,s=l/(2*Math.sqrt(a*u)),r=Math.sqrt(a/u)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=qt(r,s);p=o=>{const a=Math.exp(-s*r*o);return n-a*((t+s*r*i)/e*Math.sin(e*o)+i*Math.cos(e*o))},m=n=>{const o=Math.exp(-s*r*n);return s*r*o*(Math.sin(e*n)*(t+s*r*i)/e+i*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*r*i)-e*i*Math.sin(e*n))}}else if(1===s)p=e=>n-Math.exp(-r*e)*(i+(t+r*i)*e);else{const e=r*Math.sqrt(s*s-1);p=o=>{const a=Math.exp(-s*r*o),l=Math.min(e*o,300);return n-a*((t+s*r*i)*Math.sinh(l)+e*i*Math.cosh(l))/e}}}return f(),{next:t=>{const e=p(t);if(d)r.done=t>=h;else{const s=1e3*m(t),a=Math.abs(s)<=i,l=Math.abs(n-e)<=o;r.done=a&&l}return r.value=r.done?n:e,r},flipTarget:()=>{c=-c,[e,n]=[n,e],f()}}}Jt.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Qt=t=>0,te=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ee=(t,e,n)=>-n*t+n*e+t;function ne(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 ie({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=ne(a,i,t+1/3),s=ne(a,i,t),r=ne(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}const oe=(t,e,n)=>{const i=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-i)+i))},se=[ot,it,tt],re=t=>se.find(e=>e.test(t)),ae=(t,e)=>{let n=re(t),i=re(e),o=n.parse(t),s=i.parse(e);n===tt&&(o=ie(o),n=it),i===tt&&(s=ie(s),i=it);const r=Object.assign({},o);return t=>{for(const e in r)"alpha"!==e&&(r[e]=oe(o[e],s[e],t));return r.alpha=ee(o.alpha,s.alpha,t),n.transform(r)}},le=t=>"number"==typeof t,ue=(t,e)=>n=>e(t(n)),ce=(...t)=>t.reduce(ue);function he(t,e){return le(t)?n=>ee(t,e,n):st.test(t)?ae(t,e):fe(t,e)}const de=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>he(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},pe=(t,e)=>{const n=Object.assign(Object.assign({},t),e),i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=he(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}};function me(t){const e=ct.parse(t),n=e.length;let i=0,o=0,s=0;for(let t=0;t<n;t++)i||"number"==typeof e[t]?i++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:i,numRGB:o,numHSL:s}}const fe=(t,e)=>{const n=ct.createTransformer(e),i=me(t),o=me(e);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&i.numNumbers>=o.numNumbers?ce(de(i.parsed,o.parsed),n):n=>""+(n>0?e:t)},ve=(t,e)=>n=>ee(t,e,n);function ge(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?ve:"string"==typeof s?st.test(s)?ae:fe:Array.isArray(s)?de:"object"==typeof s?pe:void 0);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=ce(t,s)}i.push(s)}return i}function ye(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=ge(e,i,o),a=2===s?function([t,e],[n]){return i=>n(te(t,e,i))}(t,r):function(t,e){const n=t.length,i=n-1;return o=>{let s=0,r=!1;if(o<=t[0]?r=!0:o>=t[i]&&(s=i-1,r=!0),!r){let e=1;for(;e<n&&!(t[e]>o||e===i);e++);s=e-1}const a=te(t[s],t[s+1],o);return e[s](a)}}(t,r);return n?e=>a(Yt(t[0],t[s-1],e)):a}const xe=t=>e=>1-t(1-e),be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pe=t=>e=>e*e*((t+1)*e-t),Ae=t=>t,Te=(we=2,t=>Math.pow(t,we));var we;const Se=xe(Te),Ee=be(Te),Ve=t=>1-Math.sin(Math.acos(t)),Me=xe(Ve),Ce=be(Me),Re=Pe(1.525),Le=xe(Re),De=be(Re),ke=(t=>{const e=Pe(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),je=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Oe=xe(je);function Fe(t,e){return t.map(()=>e||Ee).splice(0,t.length-1)}function Ue({from:t=0,to:e=1,ease:n,offset:i,duration:o=300}){const s={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(i&&i.length===r.length?i:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(r),o);function l(){return ye(a,r,{ease:Array.isArray(n)?n:Fe(r,n)})}let u=l();return{next:t=>(s.value=u(t),s.done=t>=o,s),flipTarget:()=>{r.reverse(),u=l()}}}const Ie={keyframes:Ue,spring:Jt,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===s?l:s(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/i);return r.done=!(e>o||e<-o),r.value=r.done?u:u+e,r},flipTarget:()=>{}}}};function Be(t,e,n=0){return t-e-n}const Ne=t=>{const e=({delta:e})=>t(e);return{start:()=>Rt.update(e,!0),stop:()=>Lt.update(e)}};function ze(t){var e,n,{from:i,autoplay:o=!0,driver:s=Ne,elapsed:r=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:m}=t,f=Wt(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:x}=f,b=0,P=f.duration,A=!1,T=!0;const w=function(t){if(Array.isArray(t.to))return Ue;if(Ie[t.type])return Ie[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ue:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jt:Ue}(f);(null===(n=(e=w).needsInterpolation)||void 0===n?void 0:n.call(e,i,x))&&(y=ye([0,100],[i,x],{clamp:!1}),i=0,x=100);const S=w(Object.assign(Object.assign({},f),{from:i,to:x}));function E(){b++,"reverse"===l?(T=b%2==0,r=function(t,e,n=0,i=!0){return i?Be(e+-t,e,n):e-(t-e)+n}(r,P,u,T)):(r=Be(r,P,u),"mirror"===l&&S.flipTarget()),A=!1,p&&p()}function V(t){if(T||(t=-t),r+=t,!A){const t=S.next(Math.max(0,r));g=t.value,y&&(g=y(g)),A=T?t.done:r<=0}null==m||m(g),A&&(0===b&&(null!=P||(P=r)),b<a?function(t,e,n,i){return i?t>=e+n:t<=-n}(r,P,u,T)&&E():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function $e(t,e){return e?t*(1e3/e):0}const Ge=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),He=t=>Ge(t)&&t.hasOwnProperty("z"),We=(t,e)=>Math.abs(t-e);function Ye(t,e){if(le(t)&&le(e))return We(t,e);if(Ge(t)&&Ge(e)){const n=We(t.x,e.x),i=We(t.y,e.y),o=He(t)&&He(e)?We(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}const Xe=(t,e)=>1-3*e+3*t,qe=(t,e)=>3*e-6*t,Ke=t=>3*t,Ze=(t,e,n)=>((Xe(e,n)*t+qe(e,n))*t+Ke(e))*t,_e=(t,e,n)=>3*Xe(e,n)*t*t+2*qe(e,n)*t+Ke(e);function Je(t,e,n,i){if(t===e&&n===i)return Ae;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ze(.1*e,t,n);function s(e){let i=0,s=1;for(;10!==s&&o[s]<=e;++s)i+=.1;--s;const r=i+.1*((e-o[s])/(o[s+1]-o[s])),a=_e(r,t,n);return a>=.001?function(t,e,n,i){for(let o=0;o<8;++o){const o=_e(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,r,t,n):0===a?r:function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=Ze(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<10);return r}(e,i,i+.1,t,n)}return t=>0===t||1===t?t:Ze(s(t),e,i)}class Qe{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=nn(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ye(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=Ft();this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=tn(e,this.transformPagePoint),ft(t)&&0===t.buttons?this.handlePointerUp(t,e):Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i}=this.handlers,o=nn(tn(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},vt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const i=tn(bt(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=Ft();this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,nn(i,this.history)),this.removeListeners=ce(Gt(window,"pointermove",this.handlePointerMove),Gt(window,"pointerup",this.handlePointerUp),Gt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt.update(this.updatePoint)}}function tn(t,e){return e?{point:e(t.point)}:t}function en(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:en(t,sn(e)),offset:en(t,on(e)),velocity:rn(e,.1)}}function on(t){return t[0]}function sn(t){return t[t.length-1]}function rn(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=sn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>Ut(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function an(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ln=an("dragHorizontal"),un=an("dragVertical");function cn(t){let e=!1;if("y"===t)e=un();else if("x"===t)e=ln();else{const t=ln(),n=un();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function hn(){const t=cn(!0);return!t||(t(),!1)}function dn(t){return t.max-t.min}function pn(t,e=0,n=.01){return Ye(t,e)<n}function mn(t,e,n,i=.5){t.origin=i,t.originPoint=ee(e.min,e.max,t.origin),t.scale=dn(n)/dn(e),(pn(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=ee(n.min,n.max,t.origin)-t.originPoint,(pn(t.translate)||isNaN(t.translate))&&(t.translate=0)}function fn(t,e,n,i){mn(t.x,e.x,n.x,null==i?void 0:i.originX),mn(t.y,e.y,n.y,null==i?void 0:i.originY)}function vn(t,e,n){t.min=n.min+e.min,t.max=t.min+dn(e)}function gn(t,e,n){t.min=e.min-n.min,t.max=t.min+dn(e)}function yn(t,e,n){gn(t.x,e.x,n.x),gn(t.y,e.y,n.y)}function xn(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 bn(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 Pn=.35;function An(t,e,n){return{min:Tn(t,e),max:Tn(t,n)}}function Tn(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}var wn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(wn||(wn={}));function Sn(t){return[t("x"),t("y")]}function En({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Vn(t){return void 0===t||1===t}function Mn({scale:t,scaleX:e,scaleY:n}){return!Vn(t)||!Vn(e)||!Vn(n)}function Cn(t){return Mn(t)||Rn(t.x)||Rn(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Rn(t){return t&&"0%"!==t}function Ln(t,e,n){return n+e*(t-n)}function Dn(t,e,n,i,o){return void 0!==o&&(t=Ln(t,o,i)),Ln(t,n,i)+e}function kn(t,e=0,n=1,i,o){t.min=Dn(t.min,e,n,i,o),t.max=Dn(t.max,e,n,i,o)}function jn(t,{x:e,y:n}){kn(t.x,e.translate,e.scale,e.originPoint),kn(t.y,n.translate,n.scale,n.originPoint)}function On(t,e){t.min=t.min+e,t.max=t.max+e}function Fn(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=ee(t.min,t.max,s);kn(t,e[n],e[i],r,e.scale)}const Un=["x","scaleX","originX"],In=["y","scaleY","originY"];function Bn(t,e){Fn(t.x,e,Un),Fn(t.y,e,In)}function Nn(t,e){return En(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 zn={linear:Ae,easeIn:Te,easeInOut:Ee,easeOut:Se,circIn:Ve,circInOut:Ce,circOut:Me,backIn:Re,backInOut:De,backOut:Le,anticipate:ke,bounceIn:Oe,bounceInOut:t=>t<.5?.5*(1-je(1-2*t)):.5*je(2*t-1)+.5,bounceOut:je},$n=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return Je(e,n,i,o)}return"string"==typeof t?zn[t]:t},Gn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ct.test(e)||e.startsWith("url("))),Hn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Wn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Yn=()=>({type:"keyframes",ease:"linear",duration:.3}),Xn=t=>({type:"keyframes",duration:.8,values:t}),qn={x:Hn,y:Hn,z:Hn,rotate:Hn,rotateX:Hn,rotateY:Hn,rotateZ:Hn,scaleX:Wn,scaleY:Wn,scale:Wn,opacity:Yn,backgroundColor:Yn,color:Yn,default:Wn},Kn=(t,e)=>{let n;return n=v(e)?Xn:qn[t]||qn.default,{to:e,...n(e)}},Zn={...g,color:st,backgroundColor:st,outlineColor:st,fill:st,stroke:st,borderColor:st,borderTopColor:st,borderRightColor:st,borderBottomColor:st,borderLeftColor:st,filter:mt,WebkitFilter:mt},_n=t=>Zn[t];function Jn(t,e){var n;let i=_n(t);return i!==mt&&(i=ct),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}const Qn=!1;function ti({ease:t,times:e,yoyo:n,flip:i,loop:o,...s}){const r={...s};return e&&(r.offset=e),s.duration&&(r.duration=Ut(s.duration)),s.repeatDelay&&(r.repeatDelay=Ut(s.repeatDelay)),t&&(r.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map($n):$n(t)),"tween"===s.type&&(r.type="keyframes"),(n||o||i)&&(n?r.repeatType="reverse":o?r.repeatType="loop":i&&(r.repeatType="mirror"),r.repeat=o||n||i||s.repeat),"spring"!==s.type&&(r.type="keyframes"),r}function ei(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Kn(n,e.to)}),{...e,...ti(t)}}function ni(t,e,n,i,o){const s=si(i,t)||{};let r=void 0!==s.from?s.from:e.get();const a=Gn(t,n);"none"===r&&a&&"string"==typeof n?r=Jn(t,n):ii(r)&&"string"==typeof n?r=oi(n):!Array.isArray(n)&&ii(n)&&"string"==typeof r&&(n=oi(r));return Gn(t,r)&&a&&!1!==s.type?function(){const i={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==i&&t>i}function v(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function g(t){null==m||m.stop(),m=ze(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){g(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:v(t)});else{let i=o*e+t;void 0!==u&&(i=u(i));const r=v(i),a=r===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=$e(t-c,Ft().delta),(1===a&&t>r||-1===a&&t<r)&&y({from:t,to:r,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:l,modifyTarget:u,onUpdate:f(i)?d:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...i,...s}):ze({...ei(s,i,t),onUpdate:t=>{i.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{i.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=y(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function ii(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function oi(t){return"number"==typeof t?0:Jn("",t)}function si(t,e){return t[e]||t.default||t}function ri(t,e,n,i={}){return Qn&&(i={type:!1}),e.start(o=>{let s,r;const a=ni(t,e,n,i,o),l=function(t,e){var n,i;return null!==(i=null!==(n=(si(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==i?i:0}(i,t),u=()=>r=a();return l?s=window.setTimeout(u,Ut(l)):u(),()=>{clearTimeout(s),r&&r.stop()}})}const ai=new WeakMap;class li{constructor(t){this.openGlobalLock=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}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Qe(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(bt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();(!i||o||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cn(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Sn(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(u.test(i)){const o=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(o){i=dn(o)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==s||s(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(wn.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)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&&(null==o||o(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.syncRender(),null==s||s(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();null==o||o(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(wn.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!ui(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ee(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&x(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:xn(t.x,n,o),y:xn(t.y,e,i)}}(n.actual,t),this.elastic=function(t=Pn){return!1===t?t=0:!0===t&&(t=Pn),{x:An(t,"left","right"),y:An(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Sn(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!x(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=Nn(t,n),{scroll:o}=e;return o&&(On(i.x,o.x),On(i.y,o.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:bn(t.x,e.x),y:bn(t.y,e.y)}}(i.layout.actual,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=En(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Sn(r=>{var l;if(!ui(r,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[r])&&void 0!==l?l:{};s&&(u={min:0,max:0});const c=i?200:1e6,h=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){return ri(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Sn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Sn(e=>{const{drag:n}=this.getProps();if(!ui(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.actual[e];o.set(t[e]-ee(n,s,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!x(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Sn(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();o[t]=function(t,e){let n=.5;const i=dn(t),o=dn(e);return o>i?n=te(e.min,e.max-i,t.min):i>o&&(n=te(t.min,t.max-o,e.min)),Yt(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=s?s({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Sn(t=>{if(!ui(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(ee(i,s,o[t]))})}addListeners(){var t;ai.set(this.visualElement,this);const e=Gt(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();x(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const s=It(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Sn(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{s(),e(),o(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Pn,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ui(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function ci(t){return e(()=>()=>t(),[])}const hi=t=>e=>(t(e),null),di={pan:hi((function({onPan:t,onPanStart:o,onPanEnd:s,onPanSessionStart:r,visualElement:a}){const l=t||o||s||r,u=n(null),{transformPagePoint:c}=i(P),h={onSessionStart:r,onStart:o,onMove:t,onEnd:(t,e)=>{u.current=null,s&&s(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Ht(a,"pointerdown",l&&function(t){u.current=new Qe(t,h,{transformPagePoint:c})}),ci(()=>u.current&&u.current.end())})),drag:hi((function(t){const{dragControls:n,visualElement:i}=t,o=b(()=>new li(i));e(()=>n&&n.subscribe(o),[o,n]),e(()=>o.addListeners(),[o])}))};function pi(){const t=i(A);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,a=o();e(()=>r(a),[]);return!n&&s?[!1,()=>s&&s(a)]:[!0]}function mi(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!T.test(t))return t;t=parseFloat(t)}return`${mi(t,e.target.x)}% ${mi(t,e.target.y)}%`}};function vi(t){return"string"==typeof t&&t.startsWith("var(--")}const gi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function yi(t,e,n=1){const[i,o]=function(t){const e=gi.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():vi(o)?yi(o,e,n+1):o}const xi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(gi,t=>(s.push(t),"_$css")));const r=ct.parse(t);if(r.length>5)return i;const a=ct.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=ee(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}};class bi extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;w(Pi),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),S.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{var t;(null===(t=s.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Pi={borderRadius:{...fi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fi,borderTopRightRadius:fi,borderBottomLeftRadius:fi,borderBottomRightRadius:fi,boxShadow:xi},Ai={measureLayout:function(e){const[n,o]=pi(),s=i(E);return t.createElement(bi,{...e,layoutGroup:s,switchLayoutGroup:i(V),isPresent:n,safeToRemove:o})}};function Ti(t,e){-1===t.indexOf(e)&&t.push(e)}function wi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Si{constructor(){this.subscriptions=[]}add(t){return Ti(this.subscriptions,t),()=>wi(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ei{constructor(t){var e;this.version="7.3.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Si,this.velocityUpdateSubscribers=new Si,this.renderSubscribers=new Si,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=Ft();this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,Rt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Rt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$e(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Vi(t){return new Ei(t)}const Mi=["TopLeft","TopRight","BottomLeft","BottomRight"],Ci=Mi.length,Ri=t=>"string"==typeof t?parseFloat(t):t,Li=t=>"number"==typeof t||T.test(t);function Di(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const ki=Oi(0,.5,Me),ji=Oi(.5,.95,Ae);function Oi(t,e,n){return i=>i<t?0:i>e?1:n(te(t,e,i))}function Fi(t,e){t.min=e.min,t.max=e.max}function Ui(t,e){Fi(t.x,e.x),Fi(t.y,e.y)}function Ii(t,e,n,i,o){return t=Ln(t-=e,1/n,i),void 0!==o&&(t=Ln(t,1/o,i)),t}function Bi(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(u.test(e)){e=parseFloat(e);e=ee(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=ee(s.min,s.max,i);t===s&&(a-=e),t.min=Ii(t.min,e,n,a,o),t.max=Ii(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ni=["x","scaleX","originX"],zi=["y","scaleY","originY"];function $i(t,e,n,i){Bi(t.x,e,Ni,null==n?void 0:n.x,null==i?void 0:i.x),Bi(t.y,e,zi,null==n?void 0:n.y,null==i?void 0:i.y)}function Gi(t){return 0===t.translate&&1===t.scale}function Hi(t){return Gi(t.x)&&Gi(t.y)}function Wi(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Yi(t){return dn(t.x)/dn(t.y)}class Xi{constructor(){this.members=[]}add(t){Ti(this.members,t),t.scheduleRender()}remove(t){if(wi(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){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,o,s;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(s=null===(i=t.resumingFrom)||void 0===i?void 0:(o=i.options).onExitComplete)||void 0===s||s.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qi(t,e,n){let i=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}return i+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===i?"none":i}const Ki=(t,e)=>t.depth-e.depth;class Zi{constructor(){this.children=[],this.isDirty=!1}add(t){Ti(this.children,t),this.isDirty=!0}remove(t){wi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ki),this.isDirty=!1,this.children.forEach(t)}}const _i=["","X","Y","Z"];function Ji({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(so),this.nodes.forEach(ro)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zi)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Si),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:o,layout:s,visualElement:r}=this.options;if(r&&!r.getInstance()&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(s||o)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(i,250),S.hasAnimatedSinceResize&&(S.hasAnimatedSinceResize=!1,this.nodes.forEach(oo))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&r&&(o||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var o,s,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(s=null!==(o=this.options.transition)&&void 0!==o?o:r.getDefaultTransition())&&void 0!==s?s:po,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Wi(this.targetLayout,i)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...si(c,"layout"),onPlay:h,onComplete:d};r.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Lt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(ao))}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!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()}const{layoutId:o,layout:s}=this.options;if(void 0===o&&!s)return;const r=null===(i=this.options.visualElement)||void 0===i?void 0:i.getProps().transformTemplate;this.prevTransformTemplateValue=null==r?void 0:r(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(no);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(mo),this.potentialNodes.clear()),this.nodes.forEach(io),this.nodes.forEach(Qi),this.nodes.forEach(to),this.clearAllSnapshots(),Dt.update(),Dt.preRender(),Dt.render())}clearAllSnapshots(){this.nodes.forEach(eo),this.sharedNodes.forEach(lo)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));vo(e),this.snapshot={measured:t,layout:e,latestValues:{}}}updateLayout(){var t;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 e=this.measure();vo(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=i(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Hi(this.projectionDelta),i=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,s=null==i?void 0:i(this.latestValues,""),r=s!==this.prevTransformTemplateValue;e&&(n||Cn(this.latestValues)||r)&&(o(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(On(e.x,n.x),On(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Ui(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s,isScrollRoot:r}=i;if(i!==this.root&&o&&s.layoutScroll){if(r){Ui(e,t);const{scroll:n}=this.root;n&&(On(e.x,-n.x),On(e.y,-n.y))}On(e.x,o.x),On(e.y,o.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(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&&Bn(n,{x:-i.scroll.x,y:-i.scroll.y}),Cn(i.latestValues)&&Bn(n,i.latestValues)}return Cn(this.latestValues)&&Bn(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Ui(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!Cn(i.latestValues))continue;Mn(i.latestValues)&&i.updateSnapshot();const o={x:{min:0,max:0},y:{min:0,max:0}};Ui(o,i.measure()),$i(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layout,o)}return Cn(this.latestValues)&&$i(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection()}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}resolveTargetDelta(){var t;const{layout:e,layoutId:n}=this.options;var i,o,s;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Ui(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,vn(i.x,o.x,s.x),vn(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Ui(this.target,this.layout.actual),jn(this.target,this.targetDelta)):Ui(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yn(this.relativeTargetOrigin,this.target,this.relativeParent.target),Ui(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Cn(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!e&&!n)return;const i=this.getLead();Ui(this.layoutCorrected,this.layout.actual),function(t,e,n,i=!1){var o,s;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(s=null===(o=a.instance)||void 0===o?void 0:o.style)||void 0===s?void 0:s.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Bn(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,jn(t,l)),i&&Cn(a.latestValues)&&Bn(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==i);const{target:o}=i;if(!o)return;this.projectionDelta||(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}});const s=this.treeScale.x,r=this.treeScale.y,a=this.projectionTransform;fn(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.projectionTransform=qi(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===s&&this.treeScale.y===r||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n;const i=this.snapshot,o=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=null==i?void 0:i.isShared,c=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,h=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(ho));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var d,p,m,f;uo(r.x,t.x,i),uo(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(yn(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,p=this.relativeTargetOrigin,m=a,f=i,co(d.x,p.x,m.x,f),co(d.y,p.y,m.y,f)),l&&(this.animationValues=s,function(t,e,n,i,o,s){var r,a,l,c;o?(t.opacity=ee(0,null!==(r=n.opacity)&&void 0!==r?r:1,ki(i)),t.opacityExit=ee(null!==(a=e.opacity)&&void 0!==a?a:1,0,ji(i))):s&&(t.opacity=ee(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(c=n.opacity)&&void 0!==c?c:1,i));for(let o=0;o<Ci;o++){const s=`border${Mi[o]}Radius`;let r=Di(e,s),a=Di(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Li(r)===Li(a)?(t[s]=Math.max(ee(Ri(r),Ri(a),i),0),(u.test(a)||u.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=ee(e.rotate||0,n.rotate||0,i))}(s,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{S.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=M(t)?t:Vi(t);return ri("",i,e,n),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&go(this.options.animationType,this.layout.actual,i.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=dn(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=dn(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Ui(e,n),Bn(e,o),fn(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){var n,i,o;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Xi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(i,e)})}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)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const n={};for(let i=0;i<_i.length;i++){const o="rotate"+_i[i];t.getStaticValue(o)&&(e=!0,n[o]=t.getStaticValue(o),t.setStaticValue(o,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,i;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const s=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=C(t.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!Cn(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const a=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=qi(this.projectionDeltaWithTransform,this.treeScale,a),s&&(o.transform=s(a,o.transform));const{x:l,y:u}=this.projectionDelta;o.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(i=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:o.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in R){if(void 0===a[t])continue;const{correct:e,applyTo:n}=R[t],i=e(a[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?C(t.pointerEvents)||"":"none"),o}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(no),this.root.sharedNodes.clear()}}}function Qi(t){t.updateLayout()}function to(t){var e,n,i;const o=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:i}=t.options;"size"===i?Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(n);n.min=e[t].min,n.max=n.min+i}):go(i,o.layout,e)&&Sn(t=>{const n=o.isShared?o.measured[t]:o.layout[t],i=dn(e[t]);n.max=n.min+i});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fn(s,e,o.layout);const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o.isShared?fn(r,t.applyTransform(n,!0),o.measured):fn(r,e,o.layout);const a=!Hi(s);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:i}=t.relativeParent;if(n&&i){const t={x:{min:0,max:0},y:{min:0,max:0}};yn(t,o.layout,n.layout);const s={x:{min:0,max:0},y:{min:0,max:0}};yn(s,e,i.actual),Wi(t,s)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:o,delta:r,layoutDelta:s,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function eo(t){t.clearSnapshot()}function no(t){t.clearMeasurements()}function io(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function so(t){t.resolveTargetDelta()}function ro(t){t.calcProjection()}function ao(t){t.resetRotation()}function lo(t){t.removeLeadSnapshot()}function uo(t,e,n){t.translate=ee(e.translate,0,n),t.scale=ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function co(t,e,n,i){t.min=ee(e.min,n.min,i),t.max=ee(e.max,n.max,i)}function ho(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const po={duration:.45,ease:[.4,0,.1,1]};function mo(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function fo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function vo(t){fo(t.x),fo(t.y)}function go(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.01){return Ye(t,e)<=n}(Yi(e),Yi(n))}const yo=Ji({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xo={current:void 0},bo=Ji({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xo.current){const t=new yo(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),xo.current=t}return xo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Po={current:null},Ao={current:!1};function To(t){return Boolean(M(t)&&t.add)}function wo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const So=t=>/^0[^.\s]+$/.test(t),Eo=t=>e=>e.test(t),Vo=[d,T,u,L,D,k,{test:t=>"auto"===t,parse:t=>t}],Mo=t=>Vo.find(Eo(t)),Co=[...Vo,st,ct],Ro=t=>Co.find(Eo(t));function Lo(t,e,n){const i=t.getProps();return j(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Do(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vi(n))}function ko(t,e){if(!e)return;return(e[t]||e.default||e).from}function jo(t,e,n={}){var i;const o=Lo(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const r=o?()=>Oo(t,o,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,l=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Fo).forEach((t,i)=>{r.push(jo(t,e,{...s,delay:n+l(i)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:i,type:o}={}){var s;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in l){const i=t.getValue(e),o=l[e];if(!i||void 0===o||h&&Uo(h,e))continue;let s={delay:n,...r};t.shouldReduceMotion&&O.has(e)&&(s={...s,type:!1,delay:0});let a=ri(e,i,o,s);To(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Lo(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){Do(t,e,y(s[e]))}}(t,a)})}function Fo(t,e){return t.sortNodePosition(e)}function Uo({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const Io=[wn.Animate,wn.InView,wn.Focus,wn.Hover,wn.Tap,wn.Drag,wn.Exit],Bo=[...Io].reverse(),No=Io.length;function zo(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notifyAnimationStart(e),Array.isArray(e)){const o=e.map(e=>jo(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=jo(t,e,n);else{const o="function"==typeof e?Lo(t,e,n.custom):e;i=Oo(t,o,n)}return i.then(()=>t.notifyAnimationComplete(e))}(t,e,n)))}function $o(t){let e=zo(t);const n={[wn.Animate]:Ho(!0),[wn.InView]:Ho(),[wn.Hover]:Ho(),[wn.Tap]:Ho(),[wn.Drag]:Ho(),[wn.Focus]:Ho(),[wn.Exit]:Ho()};let i=!0;const o=(e,n)=>{const i=Lo(t,n);if(i){const{transition:t,transitionEnd:n,...o}=i;e={...e,...o,...n}}return e};function s(s,r){var a;const l=t.getProps(),u=t.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let e=0;e<No;e++){const m=Bo[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:u[m],y=U(g),x=m===r?f.isActive:null;!1===x&&(p=e);let b=g===u[m]&&g!==l[m]&&y;if(b&&i&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...d},!f.isActive&&null===x||!g&&!f.prevProp||F(g)||"boolean"==typeof g)continue;const P=Go(f.prevProp,g);let A=P||m===r&&f.isActive&&!b&&y||e>p&&y;const T=Array.isArray(g)?g:[g];let w=T.reduce(o,{});!1===x&&(w={});const{prevResolvedValues:S={}}=f,E={...S,...w},V=t=>{A=!0,h.delete(t),f.needsAnimating[t]=!0};for(const t in E){const e=w[t],n=S[t];d.hasOwnProperty(t)||(e!==n?v(e)&&v(n)?!wo(e,n)||P?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):h.add(t):void 0!==e&&h.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=w,f.isActive&&(d={...d,...w}),i&&t.blockInitialAnimation&&(A=!1),A&&!b&&c.push(...T.map(t=>({animation:t,options:{type:m,...s}})))}if(h.size){const e={};h.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),c.push({animation:e})}let m=Boolean(c.length);return i&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),i=!1,m?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,i,o){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Go(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!wo(e,t)}function Ho(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Wo=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const Yo=new Set;const Xo=("undefined"==typeof process||process.env,"production"),qo=Object.keys(I),Ko=qo.length,Zo=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:i,measureViewportBox:o,render:r,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:h,props:d,presenceId:p,blockInitialAnimation:m,visualState:v,reducedMotionConfig:g},y={})=>{let b=!1;const{latestValues:P,renderState:A}=v;let T;const w=function(){const t=Wo.map(()=>new Si),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{Wo.forEach(i=>{var o;const s="on"+i,r=t[s];null===(o=e[i])||void 0===o||o.call(e),r&&(e[i]=n[s](r))})}};return t.forEach((t,e)=>{n["on"+Wo[e]]=e=>t.add(e),n["notify"+Wo[e]]=(...e)=>t.notify(...e)}),n}(),S=new Map,E=new Map;let V={};const C={...P};let R;function L(){T&&b&&(D(),r(T,A,d.style,G.projection))}function D(){e(G,A,P,y,d)}function k(){w.notifyUpdate(P)}function j(t,e){const n=e.onChange(e=>{P[t]=e,d.onUpdate&&Rt.update(k,!1,!0)}),i=e.onRenderRequest(G.scheduleRender);E.set(t,()=>{n(),i()})}const{willChange:O,...F}=c(d);for(const t in F){const e=F[t];void 0!==P[t]&&M(e)&&(e.set(P[t],!1),To(O)&&O.add(t))}const z=B(d),$=N(d),G={treeType:t,current:null,depth:h?h.depth+1:0,parent:h,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:$?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==h?void 0:h.isMounted()),blockInitialAnimation:m,isMounted:()=>Boolean(T),mount(t){b=!0,T=G.current=t,G.projection&&G.projection.mount(t),$&&h&&!z&&(R=null==h?void 0:h.addVariantChild(G)),S.forEach((t,e)=>j(e,t)),Ao.current||function(){if(Ao.current=!0,f)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Po.current=t.matches;t.addListener(e),e()}else Po.current=!1}(),G.shouldReduceMotion="never"!==g&&("always"===g||Po.current),null==h||h.children.add(G),G.setProps(d)},unmount(){var t;null===(t=G.projection)||void 0===t||t.unmount(),Lt.update(k),Lt.render(L),E.forEach(t=>t()),null==R||R(),null==h||h.children.delete(G),w.clearAllListeners(),T=void 0,b=!1},loadFeatures(t,e,n,i,o,r){const a=[];for(let e=0;e<Ko;e++){const n=qo[e],{isEnabled:i,Component:o}=I[n];i(d)&&o&&a.push(s(o,{key:n,...t,visualElement:G}))}if(!G.projection&&o){G.projection=new o(i,G.getLatestValues(),h&&h.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:l}=t;G.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&x(a),visualElement:G,scheduleRender:()=>G.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l})}return a},addVariantChild(t){var e;const n=G.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(G.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>$?G:null==h?void 0:h.getClosestVariantNode(),getLayoutId:()=>d.layoutId,getInstance:()=>T,getStaticValue:t=>P[t],setStaticValue:(t,e)=>P[t]=e,getLatestValues:()=>P,setVisibility(t){G.isVisible!==t&&(G.isVisible=t,G.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>i(G,t,d,e),measureViewportBox:()=>o(T,d),addValue(t,e){G.hasValue(t)&&G.removeValue(t),S.set(t,e),P[t]=e.get(),j(t,e)},removeValue(t){var e;S.delete(t),null===(e=E.get(t))||void 0===e||e(),E.delete(t),delete P[t],l(t,A)},hasValue:t=>S.has(t),getValue(t,e){let n=S.get(t);return void 0===n&&void 0!==e&&(n=Vi(e),G.addValue(t,n)),n},forEachValue:t=>S.forEach(t),readValue:t=>void 0!==P[t]?P[t]:a(T,t,y),setBaseTarget(t,e){C[t]=e},getBaseTarget(t){if(n){const e=n(d,t);if(void 0!==e&&!M(e))return e}return C[t]},...w,build:()=>(D(),A),scheduleRender(){Rt.render(L,!1,!0)},syncRender:L,setProps(t){(t.transformTemplate||d.transformTemplate)&&G.scheduleRender(),d=t,w.updatePropListeners(t),V=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(M(s))t.addValue(o,s),To(i)&&i.add(o);else if(M(r))t.addValue(o,Vi(s)),To(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Vi(void 0!==e?e:s))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(G,c(d),V)},getProps:()=>d,getVariant:t=>{var e;return null===(e=d.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>d.transition,getTransformPagePoint:()=>d.transformPagePoint,getVariantContext(t=!1){if(t)return null==h?void 0:h.getVariantContext();if(!z){const t=(null==h?void 0:h.getVariantContext())||{};return void 0!==d.initial&&(t.initial=d.initial),t}const e={};for(let t=0;t<Jo;t++){const n=_o[t],i=d[n];(U(i)||!1===i)&&(e[n]=i)}return e}};return G},_o=["initial",...Io],Jo=_o.length,Qo=new Set(["width","height","top","left","right","bottom","x","y"]),ts=t=>Qo.has(t),es=(t,e)=>{t.set(e,!1),t.set(e)},ns=t=>t===d||t===T;var is;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(is||(is={}));const os=(t,e)=>parseFloat(t.split(", ")[e]),ss=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return os(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?os(e[1],t):0}},rs=new Set(["x","y","z"]),as=z.filter(t=>!rs.has(t));const ls={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:ss(4,13),y:ss(5,14)},us=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(ts);let s=[],r=!1;const a=[];if(o.forEach(o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Mo(u);const h=e[o];let d;if(v(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Mo(u);for(let n=e;n<t;n++)d?Mo(h[n]):d=Mo(h[n])}else d=Mo(h);if(c!==d)if(ns(c)&&ns(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===T&&(e[o]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[o]=c.transform(h):(r||(s=function(t){const e=[];return as.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],es(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.getInstance(),s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ls[t](i,s)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);es(i,a[n]),t[n]=ls[n](l,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),f&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function cs(t,e,n,i){return(t=>Object.keys(t).some(ts))(e)?us(t,e,n,i):{target:e,transitionEnd:i}}const hs=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.getInstance();if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!vi(e))return;const n=yi(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!vi(o))continue;const s=yi(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return cs(t,e=o.target,n,i=o.transitionEnd)};const ds={treeType:"dom",readValueFromInstance(t,e){if(O.has(e)){const t=_n(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Nn(t,e),resetTransform(t,e,n){const{transformTemplate:i}=n;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...i},{transformValues:o},s=!0){let r=function(t,e,n){var i;const o={};for(const s in t){const t=ko(s,e);o[s]=void 0!==t?t:null===(i=n.getValue(s))||void 0===i?void 0:i.get()}return o}(i,e||{},t);if(o&&(n&&(n=o(n)),i&&(i=o(i)),r&&(r=o(r))),s){!function(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||So(u))?u=parseFloat(u):!Ro(u)&&ct.test(l)&&(u=Jn(r,l)),t.addValue(r,Vi(u)),void 0===n[r]&&(n[r]=u),t.setBaseTarget(r,u))}}(t,i,r);const e=hs(t,i,r,n);n=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:n,...i}},scrapeMotionValuesFromProps:G,build(t,e,n,i,o){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),H(e,n,i,o.transformTemplate)},render:W},ps=Zo(ds),ms={animation:hi(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=$o(t)),F(n)&&e(()=>n.subscribe(t),[n])}),exit:hi(t=>{const{custom:n,visualElement:o}=t,[s,r]=pi(),a=i(A);e(()=>{o.isPresent=s;const t=o.animationState&&o.animationState.setActive(wn.Exit,!s,{custom:a&&a.custom||n});t&&!s&&t.then(r)},[s])})};function fs(t,e,n){return(i,o)=>{ft(i)&&!hn()&&(t.animationState&&t.animationState.setActive(wn.Hover,e),n&&n(i,o))}}const vs=(t,e)=>!!e&&(t===e||vs(t,e.parentElement));const gs=new WeakMap,ys=new WeakMap,xs=t=>{const e=gs.get(t.target);e&&e(t)},bs=t=>{t.forEach(xs)};function Ps(t,e,n){const i=function({root:t,...e}){const n=t||document;ys.has(n)||ys.set(n,{});const i=ys.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(bs,{root:t,...e})),i[o]}(e);return gs.set(t,n),i.observe(t),()=>{gs.delete(t),i.unobserve(t)}}const As={some:0,all:1};function Ts(t,n,i,{root:o,margin:s,amount:r="some",once:a}){e(()=>{if(!t)return;const e={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof r?r:As[r]};return Ps(i.getInstance(),e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(wn.InView,e);const o=i.getProps(),s=e?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,r])}function ws(t,n,i,{fallback:o=!0}){e(()=>{var e,s;t&&o&&("production"!==Xo&&(e="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Yo.has(e)||(console.warn(e),s&&console.warn(s),Yo.add(e))),requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(wn.InView,!0)}))},[t])}const Ss={inView:hi((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:o,viewport:s={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||o);s.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ws:Ts)(a,r.current,t,s)})),tap:hi((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:o,visualElement:s}){const r=t||e||i||o,a=n(!1),l=n(null),u={passive:!(e||t||i||m)};function c(){l.current&&l.current(),l.current=null}function h(){return c(),a.current=!1,s.animationState&&s.animationState.setActive(wn.Tap,!1),!hn()}function d(e,n){h()&&(vs(s.getInstance(),e.target)?t&&t(e,n):i&&i(e,n))}function p(t,e){h()&&i&&i(t,e)}function m(t,n){c(),a.current||(a.current=!0,l.current=ce(Gt(window,"pointerup",d,u),Gt(window,"pointercancel",p,u)),s.animationState&&s.animationState.setActive(wn.Tap,!0),e&&e(t,n))}Ht(s,"pointerdown",r?m:void 0,u),ci(c)})),focus:hi((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;Bt(e,"focus",t?()=>{n&&n.setActive(wn.Focus,!0)}:void 0),Bt(e,"blur",t?()=>{n&&n.setActive(wn.Focus,!1)}:void 0)})),hover:hi((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Ht(i,"pointerenter",t||n?fs(i,!0,t):void 0,{passive:!t}),Ht(i,"pointerleave",e||n?fs(i,!1,e):void 0,{passive:!e})}))},Es=Zo({...ds,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=_n(e))||void 0===n?void 0:n.default)||0:(e=Y.has(e)?e:X(e),t.getAttribute(e))},scrapeMotionValuesFromProps:q,build(t,e,n,i,o){K(e,n,i,o.transformTemplate)},render:Z}),Vs={...{renderer:(t,e)=>_(t)?Es(e,{enableHardwareAcceleration:!1}):ps(e,{enableHardwareAcceleration:!0}),...ms,...Ss},...di,...Ai,projectionNodeConstructor:bo};export{Vs as domMax};
@@ -1 +1 @@
1
- import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useState as i,useRef as s,useCallback as c,useMemo as l,forwardRef as u,createElement as f}from"react";const d=("undefined"==typeof process||process.env,"production"),p=t=>({isEnabled:n=>t.some(t=>!!n[t])}),m={measureLayout:p(["layout","layoutId","drag"]),animation:p(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:p(["exit"]),drag:p(["drag","dragControls"]),focus:p(["whileFocus"]),hover:p(["whileHover","onHoverStart","onHoverEnd"]),tap:p(["whileTap","onTap","onTapStart","onTapCancel"]),pan:p(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:p(["whileInView","onViewportEnter","onViewportLeave"])};const g=e({strict:!1}),y=Object.keys(m),h=y.length;const v=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),b=e({});const w=e(null),O="undefined"!=typeof document,j=O?o:a,S={current:null};let x=!1;function E(){!x&&function(){if(x=!0,O)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>S.current=t.matches;t.addListener(n),n()}else S.current=!1}();const[t]=i(S.current);return t}function P(t,n,e,o){const i=r(g),c=r(b).visualElement,l=r(w),u=function(){const t=E(),{reducedMotion:n}=r(v);return"never"!==n&&("always"===n||t)}(),f=s(void 0);o||(o=i.renderer),!f.current&&o&&(f.current=o(t,{visualState:n,parent:c,props:e,presenceId:null==l?void 0:l.id,blockInitialAnimation:!1===(null==l?void 0:l.initial),shouldReduceMotion:u}));const d=f.current;return j(()=>{null==d||d.syncRender()}),a(()=>{var t;null===(t=null==d?void 0:d.animationState)||void 0===t||t.animateChanges()}),j(()=>()=>null==d?void 0:d.notifyUnmount(),[]),d}function C(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function T(t){return"string"==typeof t||function(t){return Array.isArray(t)}(t)}function V(t){var n;return"function"==typeof(null===(n=t.animate)||void 0===n?void 0:n.start)||T(t.initial)||T(t.animate)||T(t.whileHover)||T(t.whileDrag)||T(t.whileTap)||T(t.whileFocus)||T(t.exit)}function L(t){const{initial:n,animate:e}=function(t,n){if(V(t)){const{initial:n,animate:e}=t;return{initial:!1===n||T(n)?n:void 0,animate:T(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(b));return l(()=>({initial:n,animate:e}),[k(n),k(e)])}function k(t){return Array.isArray(t)?t.join(" "):t}function A(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}const M=!1;let R=1;const B=e({}),D=e({});class X extends n.Component{getSnapshotBeforeUpdate(){return this.updateProps(),null}componentDidUpdate(){}updateProps(){const{visualElement:t,props:n}=this.props;t&&t.setProps(n)}render(){return this.props.children}}function Y({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){return n&&function(t){for(const n in t)null!==t[n]&&("projectionNodeConstructor"===n?m.projectionNodeConstructor=t[n]:m[n].Component=t[n])}(n),u((function(l,u){const f=function({layoutId:t}){var n;const e=null===(n=r(B))||void 0===n?void 0:n.id;return e&&void 0!==t?e+"-"+t:t}(l);l=Object.assign(Object.assign({},l),{layoutId:f});const p=r(v);let w=null;const j=L(l),S=p.isStatic?void 0:A(()=>{if(M)return R++}),x=i(l,p.isStatic);return!p.isStatic&&O&&(j.visualElement=P(s,x,Object.assign(Object.assign({},p),l),e),function(t,{layoutId:n,layout:e,drag:o,dragConstraints:a,layoutScroll:i},s,c){var l;const u=r(D);c&&s&&!(null==s?void 0:s.projection)&&(s.projection=new c(t,s.getLatestValues(),null===(l=s.parent)||void 0===l?void 0:l.projection),s.projection.setOptions({layoutId:n,layout:e,alwaysMeasureLayout:Boolean(o)||a&&C(a),visualElement:s,scheduleRender:()=>s.scheduleRender(),animationType:"string"==typeof e?e:"both",initialPromotionConfig:u,layoutScroll:i}))}(S,l,j.visualElement,o||m.projectionNodeConstructor),w=function(n,e,o){const a=[],i=r(g);if(!e)return null;"production"!==d&&o&&i.strict;for(let r=0;r<h;r++){const o=y[r],{isEnabled:i,Component:s}=m[o];i(n)&&s&&a.push(t.createElement(s,Object.assign({key:o},n,{visualElement:e})))}return a}(l,j.visualElement,n)),t.createElement(X,{visualElement:j.visualElement,props:Object.assign(Object.assign({},p),l)},w,t.createElement(b.Provider,{value:j},a(s,l,S,function(t,n,e){return c(r=>{var o;r&&(null===(o=t.mount)||void 0===o||o.call(t,r)),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):C(e)&&(e.current=r))},[n])}(x,j.visualElement,u),x,p.isStatic,j.visualElement)))}))}const H=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function I(t){return"string"==typeof t&&!t.includes("-")&&!!(H.indexOf(t)>-1||/[A-Z]/.test(t))}const W={},$=["","X","Y","Z"],F=["transformPerspective","x","y","z"];function Z(t,n){return F.indexOf(t)-F.indexOf(n)}["translate","scale","rotate","skew"].forEach(t=>$.forEach(n=>F.push(t+n)));const z=new Set(F);function U(t){return z.has(t)}const N=new Set(["originX","originY","originZ"]);function K(t){return N.has(t)}function q(t,{layout:n,layoutId:e}){return U(t)||K(t)||(n||void 0!==e)&&(!!W[t]||"opacity"===t)}const _=t=>Boolean(null!==t&&"object"==typeof t&&t.getVelocity),G={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function J(t){return t.startsWith("--")}const Q=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},nt=Object.assign(Object.assign({},tt),{transform:(et=0,rt=1,t=>Math.max(Math.min(t,rt),et))});var et,rt;const ot=Object.assign(Object.assign({},tt),{default:1}),at=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),it=at("deg"),st=at("%"),ct=at("px"),lt=Object.assign(Object.assign({},st),{parse:t=>st.parse(t)/100,transform:t=>st.transform(100*t)}),ut=Object.assign(Object.assign({},tt),{transform:Math.round}),ft={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,size:ct,top:ct,right:ct,bottom:ct,left:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:ot,scaleX:ot,scaleY:ot,scaleZ:ot,skew:it,skewX:it,skewY:it,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:nt,originX:lt,originY:lt,originZ:ct,zIndex:ut,fillOpacity:nt,strokeOpacity:nt,numOctaves:ut};function dt(t,n,e,r){var o;const{style:a,vars:i,transform:s,transformKeys:c,transformOrigin:l}=t;c.length=0;let u=!1,f=!1,d=!0;for(const t in n){const e=n[t];if(J(t)){i[t]=e;continue}const r=ft[t],p=Q(e,r);if(U(t)){if(u=!0,s[t]=p,c.push(t),!d)continue;e!==(null!==(o=r.default)&&void 0!==o?o:0)&&(d=!1)}else K(t)?(l[t]=p,f=!0):a[t]=p}u?a.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort(Z);let s=!1;const c=n.length;for(let e=0;e<c;e++){const r=n[e];i+=`${G[r]||r}(${t[r]}) `,"z"===r&&(s=!0)}return!s&&e&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,d,r):r?a.transform=r({},""):!n.transform&&a.transform&&(a.transform="none"),f&&(a.transformOrigin=function({originX:t="50%",originY:n="50%",originZ:e=0}){return`${t} ${n} ${e}`}(l))}const pt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function mt(t,n,e){for(const r in n)_(n[r])||q(r,e)||(t[r]=n[r])}function gt(t,n,e){let r={};return mt(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return l(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};dt(r,n,{enableHardwareAcceleration:!e},t);const{vars:o,style:a}=r;return Object.assign(Object.assign({},o),a)},[n])}(t,n,e)),t.transformValues&&(r=t.transformValues(r)),r}function yt(t,n,e){const r={},o=gt(t,n,e);return Boolean(t.drag)&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const ht=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function vt(t){return ht.has(t)}let bt=t=>!vt(t);try{(wt=require("@emotion/is-prop-valid").default)&&(bt=t=>t.startsWith("on")?!vt(t):wt(t))}catch(t){}var wt;function Ot(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function jt(t,n,e){return"string"==typeof t?t:ct.transform(n+e*t)}const St={offset:"stroke-dashoffset",array:"stroke-dasharray"},xt={offset:"strokeDashoffset",array:"strokeDasharray"};function Et(t,n,e,r){var{attrX:o,attrY:a,originX:i,originY:s,pathLength:c,pathSpacing:l=1,pathOffset:u=0}=n;dt(t,Ot(n,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),e,r),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:p}=t;f.transform&&(p&&(d.transform=f.transform),delete f.transform),p&&(void 0!==i||void 0!==s||d.transform)&&(d.transformOrigin=function(t,n,e){return`${jt(n,t.x,t.width)} ${jt(e,t.y,t.height)}`}(p,void 0!==i?i:.5,void 0!==s?s:.5)),void 0!==o&&(f.x=o),void 0!==a&&(f.y=a),void 0!==c&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?St:xt;t[a.offset]=ct.transform(-r);const i=ct.transform(n),s=ct.transform(e);t[a.array]=`${i} ${s}`}(f,c,l,u,!1)}const Pt=()=>Object.assign(Object.assign({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}});function Ct(t,n){const e=l(()=>{const e=Pt();return Et(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),Object.assign(Object.assign({},e.attrs),{style:Object.assign({},e.style)})},[n]);if(t.style){const n={};mt(n,t.style,t),e.style=Object.assign(Object.assign({},n),e.style)}return e}function Tt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(I(n)?Ct:yt)(e,a,i),c=function(t,n,e){const r={};for(const o in t)(bt(o)||!0===e&&vt(o)||!n&&!vt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),l=Object.assign(Object.assign(Object.assign({},c),s),{ref:o});return r&&(l["data-projection-id"]=r),f(n,l)}}const Vt=/([a-z])([A-Z])/g;const Lt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function kt(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(Lt.has(e)?e:e.replace(Vt,"$1-$2").toLowerCase(),n.attrs[e])}function At(t){const{style:n}=t,e={};for(const r in n)(_(n[r])||q(r,t))&&(e[r]=n[r]);return e}function Mt(t){const n=_(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}function Rt({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Dt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}const Bt=t=>(n,e)=>{const o=r(b),a=r(w);return e?Rt(t,n,o,a):A(()=>Rt(t,n,o,a))};function Dt(t,n,e,r){const o={},a=!1===(null==e?void 0:e.initial),i=r(t);for(const t in i)o[t]=Mt(i[t]);let{initial:s,animate:c}=t;const l=V(t),u=function(t){return Boolean(V(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(null!=s||(s=n.initial),null!=c||(c=n.animate));const f=a||!1===s,d=f?c:s;if(d&&"boolean"!=typeof d&&("object"!=typeof(p=d)||"function"!=typeof p.start)){(Array.isArray(d)?d:[d]).forEach(n=>{const e=function(t,n,e,r={},o={}){var a;return"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),"string"==typeof n&&(n=null===(a=t.variants)||void 0===a?void 0:a[n]),"function"==typeof n&&(n=n(null!=e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a}=e,i=Ot(e,["transitionEnd","transition"]);for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[f?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}var p;return o}const Xt={useVisualState:Bt({scrapeMotionValuesFromProps:function(t){const n=At(t);for(const e in t)if(_(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:Pt,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}Et(e,r,{enableHardwareAcceleration:!1},t.transformTemplate),kt(n,e)}})},Yt={useVisualState:Bt({scrapeMotionValuesFromProps:At,createRenderState:pt})};const Ht=function(t){function n(n,e={}){return Y(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){const a=I(t)?Xt:Yt;return Object.assign(Object.assign({},a),{preloadedFeatures:e,useRender:Tt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t})}));export{Ht as m};
1
+ import*as t from"react";import n,{createContext as e,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=e({});const m=e(null),p="undefined"!=typeof document,g=p?o:a,y=e({strict:!1});function h(t,n,e,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i(void 0);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:s,props:e,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;return g(()=>{h&&h.syncRender()}),a(()=>{h&&h.animationState&&h.animationState.animateChanges()}),g(()=>()=>h&&h.notifyUnmount(),[]),h}function v(t,n,e){return s(r=>{var o;r&&t.mount&&t.mount(r),n&&(r?n.mount(r):n.unmount()),e&&("function"==typeof e?e(r):"object"==typeof(o=e)&&Object.prototype.hasOwnProperty.call(o,"current")&&(e.current=r))},[n])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const S=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function x(t){return b(t.animate)||S.some(n=>w(t[n]))}function V(t){const{initial:n,animate:e}=function(t,n){if(x(t)){const{initial:n,animate:e}=t;return{initial:!1===n||w(n)?n:void 0,animate:w(e)?e:void 0}}return!1!==t.inherit?n:{}}(t,r(d));return c(()=>({initial:n,animate:e}),[O(n),O(e)])}function O(t){return Array.isArray(t)?t.join(" "):t}const T=t=>({isEnabled:n=>t.some(t=>!!n[t])}),C={measureLayout:T(["layout","layoutId","drag"]),animation:T(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:T(["exit"]),drag:T(["drag","dragControls"]),focus:T(["whileFocus"]),hover:T(["whileHover","onHoverStart","onHoverEnd"]),tap:T(["whileTap","onTap","onTapStart","onTapCancel"]),pan:T(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:T(["whileInView","onViewportEnter","onViewportLeave"])};function E(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}const P=!1;let k=1;const A=e({});class j extends n.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const L=e({});function M({preloadedFeatures:n,createVisualElement:e,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){return n&&function(t){for(const n in t)"projectionNodeConstructor"===n?C.projectionNodeConstructor=t[n]:C[n].Component=t[n]}(n),l((function(c,l){const u={...r(f),...c,layoutId:R(c)},{isStatic:m}=u;let g=null;const w=V(c),b=m?void 0:E(()=>{if(P)return k++}),S=i(c,m);if(!m&&p){w.visualElement=h(s,S,u,e);const t=r(y).strict,a=r(L);w.visualElement&&(g=w.visualElement.loadFeatures(c,t,n,b,o||C.projectionNodeConstructor,a))}return t.createElement(j,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(S,w.visualElement,l),S,m,w.visualElement)))}))}function R({layoutId:t}){const n=r(A).id;return n&&void 0!==t?n+"-"+t:t}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function B(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const W={},X=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Y=new Set(X);function H(t,{layout:n,layoutId:e}){return Y.has(t)||t.startsWith("origin")||(n||void 0!==e)&&(!!W[t]||"opacity"===t)}const F=t=>void 0!==t&&!!t.getVelocity,I={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$=(t,n)=>X.indexOf(t)-X.indexOf(n);function Z(t){return t.startsWith("--")}const z=(t,n)=>n&&"number"==typeof t?n.transform(t):t;const U={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},K=Object.assign(Object.assign({},U),{transform:(N=0,q=1,t=>Math.max(Math.min(t,q),N))});var N,q;const _=Object.assign(Object.assign({},U),{default:1}),G=t=>({test:n=>function(t){return"string"==typeof t}(n)&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),J=G("deg"),Q=G("%"),tt=G("px"),nt=Object.assign(Object.assign({},Q),{parse:t=>Q.parse(t)/100,transform:t=>Q.transform(100*t)}),et={...U,transform:Math.round},rt={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,size:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:_,scaleX:_,scaleY:_,scaleZ:_,skew:J,skewX:J,skewY:J,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:K,originX:nt,originY:nt,originZ:tt,zIndex:et,fillOpacity:K,strokeOpacity:K,numOctaves:et};function ot(t,n,e,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in n){const e=n[t];if(Z(t)){a[t]=e;continue}const r=rt[t],d=z(e,r);if(Y.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;e!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(l||r?o.transform=function({transform:t,transformKeys:n},{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},o,a){let i="";n.sort($);for(const e of n)i+=`${I[e]||e}(${t[e]}) `;return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,e,f,r):!n.transform&&o.transform&&(o.transform="none"),u){const{originX:t="50%",originY:n="50%",originZ:e=0}=c;o.transformOrigin=`${t} ${n} ${e}`}}const at=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function it(t,n,e){for(const r in n)F(n[r])||H(r,e)||(t[r]=n[r])}function st(t,n,e){const r={};return it(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,e){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return ot(r,n,{enableHardwareAcceleration:!e},t),Object.assign({},r.vars,r.style)},[n])}(t,n,e)),t.transformValues?t.transformValues(r):r}function ct(t,n,e){const r={},o=st(t,n,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),r.style=o,r}const lt=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function ut(t){return lt.has(t)}let ft=t=>!ut(t);try{(dt=require("@emotion/is-prop-valid").default)&&(ft=t=>t.startsWith("on")?!ut(t):dt(t))}catch(t){}var dt;function mt(t,n,e){return"string"==typeof t?t:tt.transform(n+e*t)}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},gt={offset:"strokeDashoffset",array:"strokeDasharray"};function yt(t,{attrX:n,attrY:e,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u){ot(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:m}=t;f.transform&&(m&&(d.transform=f.transform),delete f.transform),m&&(void 0!==r||void 0!==o||d.transform)&&(d.transformOrigin=function(t,n,e){return`${mt(n,t.x,t.width)} ${mt(e,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==n&&(f.x=n),void 0!==e&&(f.y=e),void 0!==a&&function(t,n,e=1,r=0,o=!0){t.pathLength=1;const a=o?pt:gt;t[a.offset]=tt.transform(-r);const i=tt.transform(n),s=tt.transform(e);t[a.array]=`${i} ${s}`}(f,a,i,s,!1)}const ht=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function vt(t,n){const e=c(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return yt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const n={};it(n,t.style,t),e.style={...n,...e.style}}return e}function wt(t=!1){return(n,e,r,o,{latestValues:a},i)=>{const s=(B(n)?vt:ct)(e,a,i),c={...function(t,n,e){const r={};for(const o in t)(ft(o)||!0===e&&ut(o)||!n&&!ut(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(e,"string"==typeof n,t),...s,ref:o};return r&&(c["data-projection-id"]=r),u(n,c)}}const bt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function St(t,n,e,r){!function(t,{style:n,vars:e},r,o){Object.assign(t.style,n,o&&o.getProjectionStyles(r));for(const n in e)t.style.setProperty(n,e[n])}(t,n,void 0,r);for(const e in n.attrs)t.setAttribute(bt.has(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n.attrs[e])}function xt(t){const{style:n}=t,e={};for(const r in n)(F(n[r])||H(r,t))&&(e[r]=n[r]);return e}function Vt(t){const n=F(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n;var e}const Ot=t=>(n,e)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:e},r,o,a){const i={latestValues:Tt(r,o,a,t),renderState:n()};return e&&(i.mount=t=>e(r,t,i)),i}(t,n,o,a);return e?i():E(i)};function Tt(t,n,e,r){const o={},a=r(t);for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=x(t),l=function(t){return Boolean(x(t)||t.variants)}(t);n&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let u=!!e&&!1===e.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(n=>{const e=function(t,n,e,r={},o={}){return"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),"string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n&&(n=n(void 0!==e?e:t.custom,r,o)),n}(t,n);if(!e)return;const{transitionEnd:r,transition:a,...i}=e;for(const t in i){let n=i[t];if(Array.isArray(n)){n=n[u?n.length-1:0]}null!==n&&(o[t]=n)}for(const t in r)o[t]=r[t]})}return o}const Ct={useVisualState:Ot({scrapeMotionValuesFromProps:function(t){const n=xt(t);for(const e in t)if(F(t[e])){n["x"===e||"y"===e?"attr"+e.toUpperCase():e]=t[e]}return n},createRenderState:ht,onMount:(t,n,{renderState:e,latestValues:r})=>{try{e.dimensions="function"==typeof n.getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}yt(e,r,{enableHardwareAcceleration:!1},t.transformTemplate),St(n,e)}})},Et={useVisualState:Ot({scrapeMotionValuesFromProps:xt,createRenderState:at})};const Pt=function(t){function n(n,e={}){return M(t(n,e))}if("undefined"==typeof Proxy)return n;const e=new Map;return new Proxy(n,{get:(t,r)=>(e.has(r)||e.set(r,n(r)),e.get(r))})}((function(t,{forwardMotionProps:n=!1},e,r,o){return{...B(t)?Ct:Et,preloadedFeatures:e,useRender:wt(n),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{Pt as m};