framer-motion
Version:
<p align="center"> <img src="https://user-images.githubusercontent.com/38039349/60953119-d3c6f300-a2fc-11e9-9596-4978e5d52180.png" width="176" height="170" alt="Framer Motion" /> </p>
1 lines • 72.8 kB
JavaScript
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((t=t||self).Motion={},t.React)}(this,function(w,W){"use strict";var q=function(){return(q=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)};function m(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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(e[r[i]]=t[r[i]])}return e}var t,n,x=function(){},E=function(){},r=0,e="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var n=Date.now(),e=Math.max(0,16.7-(n-r));r=n+e,setTimeout(function(){return t(r)},e)};(n=t||(t={})).Read="read",n.Update="update",n.Render="render",n.PostRender="postRender",n.FixedUpdate="fixedUpdate";var i=1/60*1e3,o=!0,p=!1,a=!1,u={delta:0,timestamp:0},s=[t.Read,t.Update,t.Render,t.PostRender],v=function(t){return p=t},c=s.reduce(function(t,n){var r,o,a,u,s,i,c,f,l,d=(r=v,o=[],s=!(a=[]),i=u=0,c=new WeakSet,f=new WeakSet,l={cancel:function(t){var n=a.indexOf(t);c.add(t),-1!==n&&a.splice(n,1)},process:function(t){var n,e;if(s=!0,o=(n=[a,o])[0],(a=n[1]).length=0,u=o.length)for(i=0;i<u;i++)(e=o[i])(t),!0!==f.has(e)||c.has(e)||(l.schedule(e),r(!0));s=!1},schedule:function(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1),E("function"==typeof t,"Argument must be a function");var r=e&&s,i=r?o:a;c.delete(t),n&&f.add(t),-1===i.indexOf(t)&&(i.push(t),r&&(u=o.length))}});return t.sync[n]=function(t,n,e){return void 0===n&&(n=!1),void 0===e&&(e=!1),p||h(),d.schedule(t,n,e),t},t.cancelSync[n]=function(t){return d.cancel(t)},t.steps[n]=d,t},{steps:{},sync:{},cancelSync:{}}),f=c.steps,Y=c.sync,j=c.cancelSync,l=function(t){return f[t].process(u)},d=function(t){p=!1,u.delta=o?i:Math.max(Math.min(t-u.timestamp,40),1),o||(i=u.delta),u.timestamp=t,a=!0,s.forEach(l),a=!1,p&&(o=!1,e(d))},h=function(){o=p=!0,a||e(d)},S=function(){return u},g=function(){return(g=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)},y=function(n,e){return function(t){return Math.max(Math.min(t,e),n)}},b=function(t){return t%1?Number(t.toFixed(5)):t},C=/(-)?(\d[\d\.]*)/g,O=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,T=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,A={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},P=g({},A,{transform:y(0,1)}),R=g({},A,{default:1}),M=function(n){return{test:function(t){return"string"==typeof t&&t.endsWith(n)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+n}}},k=M("deg"),V=M("%"),D=M("px"),L=M("vh"),X=M("vw"),F=g({},V,{parse:function(t){return V.parse(t)/100},transform:function(t){return V.transform(100*t)}}),H=y(0,255),B=function(t){return void 0!==t.red},z=function(t){return void 0!==t.hue},I=function(o){return function(t){if("string"!=typeof t)return t;for(var n,e={},r=(n=t,n.substring(n.indexOf("(")+1,n.lastIndexOf(")"))).split(/,\s*/),i=0;i<4;i++)e[o[i]]=void 0!==r[i]?parseFloat(r[i]):1;return e}},N=g({},A,{transform:function(t){return Math.round(H(t))}});function U(t,n){return t.startsWith(n)&&T.test(t)}var Z={test:function(t){return"string"==typeof t?U(t,"rgb"):B(t)},parse:I(["red","green","blue","alpha"]),transform:function(t){var n,e,r,i,o,a=t.red,u=t.green,s=t.blue,c=t.alpha,f=void 0===c?1:c;return n={red:N.transform(a),green:N.transform(u),blue:N.transform(s),alpha:b(P.transform(f))},e=n.red,r=n.green,i=n.blue,o=n.alpha,"rgba("+e+", "+r+", "+i+", "+(void 0===o?1:o)+")"}},G={test:function(t){return"string"==typeof t?U(t,"hsl"):z(t)},parse:I(["hue","saturation","lightness","alpha"]),transform:function(t){var n,e,r,i,o,a=t.hue,u=t.saturation,s=t.lightness,c=t.alpha,f=void 0===c?1:c;return n={hue:Math.round(a),saturation:V.transform(b(u)),lightness:V.transform(b(s)),alpha:b(P.transform(f))},e=n.hue,r=n.saturation,i=n.lightness,o=n.alpha,"hsla("+e+", "+r+", "+i+", "+(void 0===o?1:o)+")"}},$=g({},Z,{test:function(t){return"string"==typeof t&&U(t,"#")},parse:function(t){var n="",e="",r="";return 4<t.length?(n=t.substr(1,2),e=t.substr(3,2),r=t.substr(5,2)):(n=t.substr(1,1),e=t.substr(2,1),r=t.substr(3,1),n+=n,e+=e,r+=r),{red:parseInt(n,16),green:parseInt(e,16),blue:parseInt(r,16),alpha:1}}}),_={test:function(t){return"string"==typeof t&&T.test(t)||B(t)||z(t)},parse:function(t){return Z.test(t)?Z.parse(t):G.test(t)?G.parse(t):$.test(t)?$.parse(t):t},transform:function(t){return B(t)?Z.transform(t):z(t)?G.transform(t):t}},K="${c}",J=function(t){return"number"==typeof t?0:t},Q={test:function(t){if("string"!=typeof t||!isNaN(t))return!1;var n=0,e=t.match(C),r=t.match(O);return e&&(n+=e.length),r&&(n+=r.length),0<n},parse:function(t){var n=t,e=[],r=n.match(O);r&&(n=n.replace(O,K),e.push.apply(e,r.map(_.parse)));var i=n.match(C);return i&&e.push.apply(e,i.map(A.parse)),e},createTransformer:function(t){var r=t,i=0,n=t.match(O),o=n?n.length:0;if(n)for(var e=0;e<o;e++)r=r.replace(n[e],K),i++;var a=r.match(C),u=a?a.length:0;if(a)for(e=0;e<u;e++)r=r.replace(a[e],"${n}"),i++;return function(t){for(var n=r,e=0;e<i;e++)n=n.replace(e<o?K:"${n}",e<o?_.transform(t[e]):b(t[e]));return n}},getAnimatableNone:function(t){var n=Q.parse(t);return Q.createTransformer(t)(n.map(J))}},tt={x:0,y:0,z:0},nt=function(t){return"number"==typeof t},et=function(r){return function(n,e,t){return void 0!==t?r(n,e,t):function(t){return r(n,e,t)}}},rt=et(function(t,n,e){return Math.min(Math.max(e,t),n)}),it=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},ot=function(t){return it(t)&&t.hasOwnProperty("z")},at=function(t,n){return Math.abs(t-n)},ut=function(t,n){if(void 0===n&&(n=tt),nt(t)&&nt(n))return at(t,n);if(it(t)&&it(n)){var e=at(t.x,n.x),r=at(t.y,n.y),i=ot(t)&&ot(n)?at(t.z,n.z):0;return Math.sqrt(Math.pow(e,2)+Math.pow(r,2)+Math.pow(i,2))}return 0},st=function(t,n,e){var r=n-t;return 0===r?1:(e-t)/r},ct=function(t,n,e){return-e*t+e*n+t},ft=function(){return(ft=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)},lt=function(t,n,e){var r=t*t,i=n*n;return Math.sqrt(Math.max(0,e*(i-r)+r))},dt=[$,Z,G],pt=function(n){return dt.find(function(t){return t.test(n)})},vt=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},ht=function(t,n){var e=pt(t),r=pt(n);E(!!e,vt(t)),E(!!r,vt(n)),E(e.transform===r.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var i=e.parse(t),o=r.parse(n),a=ft({},i),u=e===G?ct:lt;return function(t){for(var n in a)"alpha"!==n&&(a[n]=u(i[n],o[n],t));return a.alpha=ct(i.alpha,o.alpha,t),e.transform(a)}},mt=function(n,e){return function(t){return e(n(t))}},gt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.reduce(mt)};function yt(n,e){return nt(n)?function(t){return ct(n,e,t)}:_.test(n)?ht(n,e):Et(n,e)}var bt=function(t,e){var r=t.slice(),i=r.length,o=t.map(function(t,n){return yt(t,e[n])});return function(t){for(var n=0;n<i;n++)r[n]=o[n](t);return r}},wt=function(t,n){var e=ft({},t,n),r={};for(var i in e)void 0!==t[i]&&void 0!==n[i]&&(r[i]=yt(t[i],n[i]));return function(t){for(var n in r)e[n]=r[n](t);return e}};function xt(t){for(var n=Q.parse(t),e=n.length,r=0,i=0,o=0,a=0;a<e;a++)r||"number"==typeof n[a]?r++:void 0!==n[a].hue?o++:i++;return{parsed:n,numNumbers:r,numRGB:i,numHSL:o}}var Et=function(t,n){var e=Q.createTransformer(n),r=xt(t),i=xt(n);return E(r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers,"Complex values '"+t+"' and '"+n+"' too different to mix. Ensure all colors are of the same type."),gt(bt(r.parsed,i.parsed),e)},Ct=function(n,e){return function(t){return ct(n,e,t)}};function St(t,n,e){for(var r,i=[],o=e||("number"==typeof(r=t[0])?Ct:"string"==typeof r?_.test(r)?ht:Et:Array.isArray(r)?bt:"object"==typeof r?wt:void 0),a=t.length-1,u=0;u<a;u++){var s=o(t[u],t[u+1]);if(n){var c=Array.isArray(n)?n[u]:n;s=gt(c,s)}i.push(s)}return i}function Ot(t,n,e){var r=void 0===e?{}:e,i=r.clamp,o=void 0===i||i,a=r.ease,u=r.mixer,s=t.length;E(s===n.length,"Both input and output ranges must be the same length"),E(!a||!Array.isArray(a)||a.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),n=[].concat(n),t.reverse(),n.reverse());var c,f,l,d,p,v,h,m,g,y=St(n,a,u),b=2===s?(v=y,h=(p=t)[0],m=p[1],g=v[0],function(t){return g(st(h,m,t))}):(f=y,l=(c=t).length,d=l-1,function(t){var n=0,e=!1;if(t<=c[0]?e=!0:t>=c[d]&&(n=d-1,e=!0),!e){for(var r=1;r<l&&!(c[r]>t||r===d);r++);n=r-1}var i=st(c[n],c[n+1],t);return f[n](i)});return o?gt(rt(t[0],t[s-1]),b):b}var Tt=function(t,n){return n?t*(1e3/n):0},At=et(function(t,n,e){var r=n-t;return((e-t)%r+r)%r+t}),Pt=(rt(0,1),function(){function e(t,n){var e,o=this,r=void 0===n?{}:n,i=r.transformer,a=r.parent;this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.updateAndNotify=function(t,n){void 0===n&&(n=!0),o.prev=o.current,o.current=o.transformer?o.transformer(t):t,o.updateSubscribers&&o.prev!==o.current&&o.updateSubscribers.forEach(o.notifySubscriber),o.children&&o.children.forEach(o.setChild),n&&o.renderSubscribers&&o.renderSubscribers.forEach(o.notifySubscriber);var e=S(),r=e.delta,i=e.timestamp;o.lastUpdated!==i&&(o.timeDelta=r,o.lastUpdated=i,Y.postRender(o.scheduleVelocityCheck))},this.notifySubscriber=function(t){t(o.current)},this.scheduleVelocityCheck=function(){return Y.postRender(o.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==o.lastUpdated&&(o.prev=o.current)},this.setChild=function(t){return t.set(o.current)},this.parent=a,this.transformer=i,this.set(t,!1),this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return e.prototype.addChild=function(t){void 0===t&&(t={});var n=new e(this.current,q({parent:this},t));return this.children||(this.children=new Set),this.children.add(n),n},e.prototype.removeChild=function(t){this.children&&this.children.delete(t)},e.prototype.subscribeTo=function(t,n){var e=this,r=function(){return n(e.current)};return t.add(r),function(){return t.delete(r)}},e.prototype.onChange=function(t){return this.updateSubscribers||(this.updateSubscribers=new Set),this.subscribeTo(this.updateSubscribers,t)},e.prototype.onRenderRequest=function(t){return this.renderSubscribers||(this.renderSubscribers=new Set),this.notifySubscriber(t),this.subscribeTo(this.renderSubscribers,t)},e.prototype.attach=function(t){this.passiveEffect=t},e.prototype.set=function(t,n){void 0===n&&(n=!0),n&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,n)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.canTrackVelocity?Tt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(n){var e=this;return this.stop(),new Promise(function(t){e.stopAnimation=n(t)}).then(function(){return e.clearAnimation()})},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers&&this.updateSubscribers.clear(),this.renderSubscribers&&this.renderSubscribers.clear(),this.parent&&this.parent.removeChild(this),this.stop()},e}());function Rt(t,n){return new Pt(t,n)}var Mt=function(){return(Mt=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}).apply(this,arguments)};function kt(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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)n.indexOf(r[i])<0&&(e[r[i]]=t[r[i]])}return e}var Vt,Dt=function(t){var e=t.onRead,n=t.onRender,r=t.uncachedValues,c=void 0===r?new Set:r,i=t.useCache,f=void 0===i||i;return function(t){void 0===t&&(t={});var r=kt(t,[]),i={},o=[],a=!1;function u(t,n){t.startsWith("--")&&(r.hasCSSVariable=!0);var e=i[t];i[t]=n,i[t]!==e&&(-1===o.indexOf(t)&&o.push(t),a||(a=!0,Y.render(s.render)))}var s={get:function(t,n){return void 0===n&&(n=!1),!n&&f&&!c.has(t)&&void 0!==i[t]?i[t]:e(t,r)},set:function(t,n){if("string"==typeof t)u(t,n);else for(var e in t)u(e,t[e]);return this},render:function(t){return void 0===t&&(t=!1),(a||!0===t)&&(n(i,r,o),a=!1,o.length=0),this}};return s}},Lt=/([a-z])([A-Z])/g,Xt=function(t){return t.replace(Lt,"$1-$2").toLowerCase()},Yt=new Map,jt=new Map,Ft=["Webkit","Moz","O","ms",""],Ht=Ft.length,Bt="undefined"!=typeof document,zt=function(t,n){return jt.set(t,Xt(n))},It=function(t,n){void 0===n&&(n=!1);var e,r=n?jt:Yt;return r.has(t)||(Bt?function(t){Vt=Vt||document.createElement("div");for(var n=0;n<Ht;n++){var e=Ft[n],r=""===e,i=r?t:e+t.charAt(0).toUpperCase()+t.slice(1);if(i in Vt.style||r){if(r&&"clipPath"===t&&jt.has(t))return;Yt.set(t,i),zt(t,(r?"":"-")+Xt(i))}}}(t):zt(e=t,e)),r.get(t)||t},Nt=["","X","Y","Z"],Ut=["translate","scale","rotate","skew","transformPerspective"].reduce(function(t,e){return Nt.reduce(function(t,n){return t.push(e+n),t},t)},["x","y","z"]),Wt=Ut.reduce(function(t,n){return t[n]=!0,t},{});function qt(t){return!0===Wt[t]}function Zt(t,n){return Ut.indexOf(t)-Ut.indexOf(n)}var Gt=new Set(["originX","originY","originZ"]);var $t=Mt({},A,{transform:Math.round}),_t={color:_,backgroundColor:_,outlineColor:_,fill:_,stroke:_,borderColor:_,borderTopColor:_,borderRightColor:_,borderBottomColor:_,borderLeftColor:_,borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,radius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,size:D,top:D,right:D,bottom:D,left:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,rotate:k,rotateX:k,rotateY:k,rotateZ:k,scale:R,scaleX:R,scaleY:R,scaleZ:R,skew:k,skewX:k,skewY:k,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,opacity:P,originX:F,originY:F,originZ:D,zIndex:$t,fillOpacity:P,strokeOpacity:P,numOctaves:$t},Kt=function(t){return _t[t]},Jt=function(t,n){return n&&"number"==typeof t?n.transform(t):t},Qt="scrollLeft",tn="scrollTop",nn=new Set([Qt,tn]),en=new Set([Qt,tn,"transform"]),rn={x:"translateX",y:"translateY",z:"translateZ"};function on(t){return"function"==typeof t}function an(t,n,e,r,i,o,a){void 0===n&&(n=!0),void 0===e&&(e={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o=[]),void 0===a&&(a=!1);var u,s=!0,c=!1,f=!1;for(var l in t){var d=t[l],p=Kt(l),v=Jt(d,p);qt(l)?(c=!0,r[l]=v,o.push(l),s&&(p.default&&d!==p.default||!p.default&&0!==d)&&(s=!1)):(u=l,Gt.has(u)?(i[l]=v,f=!0):en.has(l)&&on(v)||(e[It(l,a)]=v))}return(c||"function"==typeof t.transform)&&(e.transform=function(t,n,e,r,i){var o="",a=!1;e.sort(Zt);for(var u=e.length,s=0;s<u;s++){var c=e[s];o+=(rn[c]||c)+"("+n[c]+") ",a="z"===c||a}return!a&&i?o+="translateZ(0)":o=o.trim(),on(t.transform)?o=t.transform(n,o):r&&(o="none"),o}(t,r,o,s,n)),f&&(e.transformOrigin=(i.originX||"50%")+" "+(i.originY||"50%")+" "+(i.originZ||0)),e}function un(n,e){void 0===n&&(n=!0),void 0===e&&(e=!0);var r={},i={},o={},a=[];return function(t){return a.length=0,an(t,n,r,i,o,a,e),r}}var sn=Dt({onRead:function(t,n){var e=n.element,r=n.preparseOutput,i=Kt(t);if(qt(t))return i&&i.default||0;if(nn.has(t))return e[t];var o=window.getComputedStyle(e,null).getPropertyValue(It(t,!0))||0;return r&&i&&i.test(o)&&i.parse?i.parse(o):o},onRender:function(t,n,e){var r=n.element,i=n.buildStyles,o=n.hasCSSVariable;if(Object.assign(r.style,i(t)),o)for(var a=e.length,u=0;u<a;u++){var s=e[u];s.startsWith("--")&&r.style.setProperty(s,t[s])}-1!==e.indexOf(Qt)&&(r[Qt]=t[Qt]),-1!==e.indexOf(tn)&&(r[tn]=t[tn])},uncachedValues:nn});var cn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),fn=.5,ln=function(){return{style:{}}},dn=function(t,n){return D.transform(t*n)},pn={x:0,y:0,width:0,height:0};function vn(t,n,e){return"string"==typeof t?t:D.transform(n+e*t)}function hn(t,n,e,r,i,o){void 0===n&&(n=pn),void 0===r&&(r=un(!1,!1)),void 0===i&&(i=ln()),void 0===o&&(o=!0);var a,u,s=t.attrX,c=t.attrY,f=t.originX,l=t.originY,d=t.pathLength,p=t.pathSpacing,v=void 0===p?1:p,h=t.pathOffset,m=void 0===h?0:h,g=r(kt(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var y in g){if("transform"===y)i.style.transform=g[y];else i[o&&!cn.has(y)?Xt(y):y]=g[y]}return(void 0!==f||void 0!==l||g.transform)&&(i.style.transformOrigin=(u=void 0!==l?l:fn,vn(void 0!==f?f:fn,(a=n).x,a.width)+" "+vn(u,a.y,a.height))),void 0!==s&&(i.x=s),void 0!==c&&(i.y=c),void 0!==e&&void 0!==d&&(i[o?"stroke-dashoffset":"strokeDashoffset"]=dn(-m,e),i[o?"stroke-dasharray":"strokeDasharray"]=dn(d,e)+" "+dn(v,e)),i}var mn=Dt({onRead:function(t,n){var e=n.element;if(qt(t=cn.has(t)?t:Xt(t))){var r=Kt(t);return r&&r.default||0}return e.getAttribute(t)},onRender:function(t,n){var e=n.element,r=(0,n.buildAttrs)(t);for(var i in r)"style"===i?Object.assign(e.style,r.style):e.setAttribute(i,r[i])}}),gn=function(t){var n=function(t){try{return"function"==typeof(n=t).getBBox?n.getBBox():n.getBoundingClientRect()}catch(t){return{x:0,y:0,width:0,height:0}}var n}(t),e="path"===t.tagName&&t.getTotalLength?t.getTotalLength():void 0;return mn({element:t,buildAttrs:function(n,e,r){void 0===r&&(r=!0);var i=ln(),o=un(!1,!1);return function(t){return hn(t,n,e,o,i,r)}}(n,e)})},yn=Dt({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var n=t.scrollTop,e=void 0===n?0:n,r=t.scrollLeft,i=void 0===r?0:r;return window.scrollTo(i,e)}}),bn=new WeakMap,wn=function(t,n){var e;return t instanceof HTMLElement?e=function(t,n){void 0===n&&(n={});var e=n.enableHardwareAcceleration,r=kt(n,["enableHardwareAcceleration"]);return sn(Mt({element:t,buildStyles:un(e),preparseOutput:!0},r))}(t,n):t instanceof SVGElement?e=gn(t):t===window&&(e=yn(t)),E(void 0!==e,"No valid node provided. Node must be HTMLElement, SVGElement or window."),bn.set(t,e),e},xn=function(t,n){return bn.has(t)?bn.get(t):wn(t,n)};function En(t,n){var e="string"==typeof t?document.querySelector(t):t;return xn(e,n)}function Cn(t){var n=W.useRef(null);return null===n.current&&(n.current=t()),n.current}var Sn=function(t){return t instanceof Pt},On=Dt({onRead:function(){return null},onRender:function(t,n){return(0,n.onUpdate)(t)}}),Tn=function(){function t(){this.hasMounted=!1,this.values=new Map,this.unsubscribers=new Map}return t.prototype.has=function(t){return this.values.has(t)},t.prototype.set=function(t,n){this.values.set(t,n),this.hasMounted&&this.bindValueToOutput(t,n)},t.prototype.get=function(t,n){var e=this.values.get(t);return void 0===e&&void 0!==n&&(e=new Pt(n),this.set(t,e)),e},t.prototype.forEach=function(t){return this.values.forEach(t)},t.prototype.bindValueToOutput=function(n,t){var e=this,r=t.onRenderRequest(function(t){return e.output&&e.output(n,t)}),i=t.onChange(function(t){e.onUpdate&&e.onUpdate.set(n,t)});this.unsubscribers.has(n)&&this.unsubscribers.get(n)(),this.unsubscribers.set(n,function(){r(),i()})},t.prototype.setOnUpdate=function(t){this.onUpdate=void 0,t&&(this.onUpdate=On({onUpdate:t}))},t.prototype.setTransformTemplate=function(t){this.transformTemplate!==t&&(this.transformTemplate=t,this.updateTransformTemplate())},t.prototype.getTransformTemplate=function(){return this.transformTemplate},t.prototype.updateTransformTemplate=function(){this.output&&this.output("transform",this.transformTemplate)},t.prototype.mount=function(t){var e=this;this.hasMounted=!0,t&&(this.output=t),this.values.forEach(function(t,n){return e.bindValueToOutput(n,t)}),this.updateTransformTemplate()},t.prototype.unmount=function(){var r=this;this.values.forEach(function(t,n){var e=r.unsubscribers.get(n);e&&e()})},t}(),An=new Set(["dragOriginX","dragOriginY"]),Pn=function(e){var t=Cn(function(){var t=new Tn;for(var n in e)Sn(e[n])&&!An.has(n)&&t.set(n,e[n]);return t});return t.setOnUpdate(e.onUpdate),t.setTransformTemplate(e.transformTemplate),t},Rn=null,Mn=function(){return null!==Rn},kn=function(){E(!Rn,"Sync render session already open"),Rn=[]},Vn=function(){E(null!==Rn,"No sync render session found"),Rn&&Rn.forEach(function(t){return t.render()}),Rn=null},Dn=function(t){E(null!==Rn,"No sync render session found"),Rn&&Rn.push(t)},Ln=function(t){return"object"==typeof t&&t.hasOwnProperty("current")};function Xn(n,e){W.useEffect(function(){if(e){if("function"==typeof e)return e(n.current),function(){return e(null)};if(Ln(e)){var t=e;return t.current=n.current,function(){e.current===n.current&&(t.current=null)}}}},[])}var Yn,jn=W.memo(W.forwardRef(function(t,n){var r=t.values,i=t.isStatic,e=t.externalRef;return W.useEffect(function(){E(n.current instanceof Element,"No `ref` found. Ensure components created with `motion.custom` forward refs using `React.forwardRef`");var e=En(n.current,{preparseOutput:!1,enableHardwareAcceleration:!i});return r.mount(function(t,n){e.set(t,n),Mn()&&Dn(e)}),function(){return r.unmount()}},[]),Xn(n,e),null})),Fn=(Yn=function(t){return t.get()},function(t){var e={};return t.forEach(function(t,n){return e[n]=Yn(t)}),e}),Hn=new Set(["originX","originY","originZ"]),Bn=function(t){return Array.isArray(t)},zn=function(t){return Bn(t)?t[t.length-1]||0:t},In=[A,D,V,k,X,L,{test:function(t){return"auto"===t},parse:function(t){return t}}],Nn=In.concat([_,Q]),Un=function(n){return function(t){return t.test(n)}},Wn=function(t){return In.find(Un(t))},qn=function(n){return function(t){return 1-n(1-t)}},Zn=qn,Gn=function(t){return t},$n=qn(function(n){return function(t){return Math.pow(t,n)}}(2)),_n=function(){return function(t,n){var e=this,r=t.middleware,i=t.onComplete;this.isActive=!0,this.update=function(t){e.observer.update&&e.updateObserver(t)},this.complete=function(){e.observer.complete&&e.isActive&&e.observer.complete(),e.onComplete&&e.onComplete(),e.isActive=!1},this.error=function(t){e.observer.error&&e.isActive&&e.observer.error(t),e.isActive=!1},this.observer=n,this.updateObserver=function(t){return n.update(t)},this.onComplete=i,n.update&&r&&r.length&&r.forEach(function(t){return e.updateObserver=t(e.updateObserver,e.complete)})}}(),Kn=function(){function n(t){void 0===t&&(t={}),this.props=t}return n.prototype.create=function(t){return new n(t)},n.prototype.start=function(t){void 0===t&&(t={});var n,e,r,i=!1,o={stop:function(){}},a=this.props,u=a.init,s=m(a,["init"]),c=u((n=t,e=function(){i=!0,o.stop()},r=s.middleware,new _n({middleware:r,onComplete:e},"function"==typeof n?{update:n}:n)));return o=c?q({},o,c):o,i&&o.stop(),o},n.prototype.applyMiddleware=function(t){return this.create(q({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},n.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=1===t.length?t[0]:gt.apply(void 0,t);return this.applyMiddleware(function(n){return function(t){return n(e(t))}})},n}(),Jn=function(t){return new Kn({init:t})},Qn=[D,V,k,L,X],te=function(n){return Qn.find(function(t){return t.test(n)})},ne=function(t,n){return t(n)},ee=function(t,n){var e=n.from,r=n.to,i=m(n,["from","to"]),o=te(e)||te(r),a=o.transform,u=o.parse;return t(q({},i,{from:"string"==typeof e?u(e):e,to:"string"==typeof r?u(r):r})).pipe(a)},re=function(o){return function(t,n){var e=n.from,r=n.to,i=m(n,["from","to"]);return t(q({},i,{from:0,to:1})).pipe(o(e,r))}},ie=re(ht),oe=re(Et),ae=function(r,t){var e,i,o,n=(e=t,i=Object.keys(e),o=function(t,n){return void 0!==t&&!e[n](t)},{getVectorKeys:function(e){return i.reduce(function(t,n){return o(e[n],n)&&t.push(n),t},[])},testVectorProps:function(n){return n&&i.some(function(t){return o(n[t],t)})}}),a=n.testVectorProps,u=n.getVectorKeys;return function(t){if(!a(t))return r(t);var n=u(t),e=t[n[0]];return ue(e)(r,t,n)}},ue=function(t){return"number"==typeof t?ne:Boolean(te(t))?ee:_.test(t)?ie:Q.test(t)?oe:ne},se=ae(function(b){return void 0===b&&(b={}),Jn(function(t){var i=t.complete,o=t.update,n=b.velocity,e=void 0===n?0:n,r=b.from,a=void 0===r?0:r,u=b.power,s=void 0===u?.8:u,c=b.timeConstant,f=void 0===c?350:c,l=b.restDelta,d=void 0===l?.5:l,p=b.modifyTarget,v=0,h=s*e,m=Math.round(a+h),g=void 0===p?m:p(m),y=Y.update(function(t){var n=t.delta;v+=n;var e=-h*Math.exp(-v/f),r=d<e||e<-d;o(r?g+e:g),r||(j.update(y),i())},!0);return{stop:function(){return j.update(y)}}})},{from:A.test,modifyTarget:function(t){return"function"==typeof t},velocity:A.test}),ce=ae(function(O){return void 0===O&&(O={}),Jn(function(t){var s=t.update,c=t.complete,n=O.velocity,f=void 0===n?0:n,e=O.from,r=void 0===e?0:e,i=O.to,l=void 0===i?0:i,o=O.stiffness,d=void 0===o?100:o,a=O.damping,p=void 0===a?10:a,u=O.mass,v=void 0===u?1:u,h=O.restSpeed,m=void 0===h?.01:h,g=O.restDelta,y=void 0===g?.01:g,b=f?-f/1e3:0,w=0,x=l-r,E=r,C=E,S=Y.update(function(t){var n=t.delta;w+=n;var e=p/(2*Math.sqrt(d*v)),r=Math.sqrt(d/v)/1e3;if(C=E,e<1){var i=Math.exp(-e*r*w),o=r*Math.sqrt(1-e*e);E=l-i*((b+e*r*x)/o*Math.sin(o*w)+x*Math.cos(o*w))}else{i=Math.exp(-r*w);E=l-i*(x+(b+r*x)*w)}f=Tt(E-C,n);var a=Math.abs(f)<=m,u=Math.abs(l-E)<=y;a&&u?(s(E=l),j.update(S),c()):s(E)},!0);return{stop:function(){return j.update(S)}}})},{from:A.test,to:A.test,stiffness:A.test,damping:A.test,mass:A.test,velocity:A.test}),fe=ae(function(t){var n=t.from,v=void 0===n?0:n,e=t.velocity,h=void 0===e?0:e,m=t.min,g=t.max,r=t.power,y=void 0===r?.8:r,i=t.timeConstant,b=void 0===i?700:i,o=t.bounceStiffness,w=void 0===o?500:o,a=t.bounceDamping,x=void 0===a?10:a,u=t.restDelta,E=void 0===u?1:u,C=t.modifyTarget;return Jn(function(t){var r,i=t.update,e=t.complete,o=v,a=v,u=!1,s=function(t){return void 0!==m&&t<=m},c=function(t){return void 0!==g&&g<=t},n=function(t){return s(t)||c(t)},f=function(t){var n,e;i(t),o=a,h=Tt((a=t)-o,S().delta),r&&!u&&(e=h,s(n=t)&&e<0||c(n)&&0<e)&&d({from:t,velocity:h})},l=function(t,n){r&&r.stop(),r=t.start({update:f,complete:function(){n?n():e()}})},d=function(t){u=!0,l(ce(q({},t,{to:s(t.from)?m:g,stiffness:w,damping:x,restDelta:E})))};if(n(v))d({from:v,velocity:h});else if(0!==h){var p=se({from:v,velocity:h,timeConstant:b,power:y,restDelta:n(v)?20:E,modifyTarget:C});l(p,function(){n(a)?d({from:a,velocity:h}):e()})}else e();return{stop:function(){return r&&r.stop()}}})},{from:A.test,velocity:A.test,min:A.test,max:A.test,damping:A.test,stiffness:A.test,modifyTarget:function(t){return"function"==typeof t}}),le=ae(function(t){var n=t.from,e=void 0===n?0:n,r=t.to,i=void 0===r?1:r,o=t.ease,a=void 0===o?Gn:o,u=t.reverseEase;return void 0!==u&&u&&(a=Zn(a)),Jn(function(t){var n=t.update;return{seek:function(t){return n(t)}}}).pipe(a,function(t){return ct(e,i,t)})},{ease:function(t){return"function"==typeof t},from:A.test,to:A.test}),de=rt(0,1),pe=function(X){return void 0===X&&(X={}),Jn(function(t){var r,e=t.update,i=t.complete,n=X.duration,o=void 0===n?300:n,a=X.ease,u=void 0===a?$n:a,s=X.flip,c=void 0===s?0:s,f=X.loop,l=void 0===f?0:f,d=X.yoyo,p=void 0===d?0:d,v=X.repeatDelay,h=void 0===v?0:v,m=X.from,g=void 0===m?0:m,y=X.to,b=void 0===y?1:y,w=X.elapsed,x=void 0===w?0:w,E=X.flipCount,C=void 0===E?0:E,S=X.yoyoCount,O=void 0===S?0:S,T=X.loopCount,A=void 0===T?0:T,P=le({from:g,to:b,ease:u}).start(e),R=0,M=!1,k=function(t){var n;void 0===t&&(t=!1),P=le({from:g=(n=[b,g])[0],to:b=n[1],ease:u,reverseEase:t}).start(e)},V=function(){R=de(st(0,o,x)),P.seek(R)},D=function(){M=!0,r=Y.update(function(t){var n,e=t.delta;x+=e,V(),!(n=M&&o+h<x)||(!n||l||c||p)&&(x=x-o-h,l&&A<l?(A++,1):c&&C<c?(C++,k(),1):p&&O<p&&(k(++O%2!=0),1))||(j.update(r),i&&Y.update(i,!1,!0))},!0)},L=function(){M=!1,r&&j.update(r)};return D(),{isActive:function(){return M},getElapsed:function(){return rt(0,o,x)},getProgress:function(){return R},stop:function(){L()},pause:function(){return L(),this},resume:function(){return M||D(),this},seek:function(t){return x=ct(0,o,t),Y.update(V,!1,!0),this},reverse:function(){return k(),this}}})},ve=rt(0,1),he=function(r,i,o){return Jn(function(t){var n=t.update,e=i.split(" ").map(function(t){return r.addEventListener(t,n,o),t});return{stop:function(){return e.forEach(function(t){return r.removeEventListener(t,n,o)})}}})},me=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},ge=function(t,n){return void 0===n&&(n={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),n.clientX=n.x=t.clientX,n.clientY=n.y=t.clientY,n.pageX=t.pageX,n.pageY=t.pageY,n},ye=[me()];if("undefined"!=typeof document){he(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){for(var n=t.touches,e=n.length,r=ye.length=0;r<e;r++){var i=n[r];ye.push(ge(i))}})}var be=me();if("undefined"!=typeof document){he(document,"mousedown mousemove",!0).start(function(t){ge(t,be)})}var we=function(r){return Jn(function(t){var n=t.complete,e=setTimeout(n,r);return{stop:function(){return clearTimeout(e)}}})},xe=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Ee=function(t){return{type:"spring",stiffness:700,damping:0===t?100:35}},Ce=function(){return{ease:"linear",duration:.3}},Se=function(t){return{type:"keyframes",duration:.8,values:t}},Oe={x:xe,y:xe,z:xe,rotate:xe,rotateX:xe,rotateY:xe,rotateZ:xe,scaleX:Ee,scaleY:Ee,scale:Ee,opacity:Ce,backgroundColor:Ce,color:Ce,default:Ee},Te=function(t){var r=t.to,i=t.duration;return Jn(function(t){var n=t.update,e=t.complete;n(r),i?we(i).start({complete:e}):e()})},Ae=function(n){return function(t){return 1-n(1-t)}},Pe=function(n){return function(t){return t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2}},Re=Ae,Me=Pe,ke=function(n){return function(t){return Math.pow(t,n)}},Ve=function(n){return function(t){return t*t*((n+1)*t-n)}},De=function(t){var n=Ve(t);return function(t){return(t*=2)<1?.5*n(t):.5*(2-Math.pow(2,-10*(t-1)))}},Le=function(t){return t},Xe=ke(2),Ye=Ae(Xe),je=Pe(Xe),Fe=function(t){return 1-Math.sin(Math.acos(t))},He=Ae(Fe),Be=Pe(He),ze=Ve(1.525),Ie=Ae(ze),Ne=Pe(ze),Ue=De(1.525),We=function(t){var n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},qe="undefined"!=typeof Float32Array,Ze=function(t,n){return 1-3*n+3*t},Ge=function(t,n){return 3*n-6*t},$e=function(t){return 3*t},_e=function(t,n,e){return 3*Ze(n,e)*t*t+2*Ge(n,e)*t+$e(n)},Ke=function(t,n,e){return((Ze(n,e)*t+Ge(n,e))*t+$e(n))*t};function Je(a,n,u,e){var s=qe?new Float32Array(11):new Array(11),r=function(t){for(var n,e,r,i=0,o=1;10!==o&&s[o]<=t;++o)i+=.1;return n=(t-s[--o])/(s[o+1]-s[o]),.001<=(r=_e(e=i+.1*n,a,u))?function(t,n){for(var e=0,r=0;e<8;++e){if(0===(r=_e(n,a,u)))return n;n-=(Ke(n,a,u)-t)/r}return n}(t,e):0===r?e:function(t,n,e){for(var r,i,o=0;0<(r=Ke(i=n+(e-n)/2,a,u)-t)?e=i:n=i,1e-7<Math.abs(r)&&++o<10;);return i}(t,i,i+.1)};!function(){for(var t=0;t<11;++t)s[t]=Ke(.1*t,a,u)}();return function(t){return a===n&&u===e?t:0===t?0:1===t?1:Ke(r(t),n,e)}}var Qe=Object.freeze({reversed:Ae,mirrored:Pe,createReversedEasing:Re,createMirroredEasing:Me,createExpoIn:ke,createBackIn:Ve,createAnticipateEasing:De,linear:Le,easeIn:Xe,easeOut:Ye,easeInOut:je,circIn:Fe,circOut:He,circInOut:Be,backIn:ze,backOut:Ie,backInOut:Ne,anticipate:Ue,bounceOut:We,bounceIn:function(t){return 1-We(1-t)},bounceInOut:function(t){return t<.5?.5*(1-We(1-2*t)):.5*We(2*t-1)+.5},cubicBezier:Je}),tr=function(t){return Array.isArray(t)?(E(4===t.length,"Cubic bezier arrays must contain four numerical values."),Je(t[0],t[1],t[2],t[3])):"string"==typeof t?(E(void 0!==Qe[t],"Invalid easing type '"+t+"'"),Qe[t]):t},nr=function(t){return Array.isArray(t)&&"number"!=typeof t[0]},er=function(t,n){return"zIndex"!==t&&(!("number"!=typeof n&&!Array.isArray(n))||!("string"!=typeof n||!Q.test(n)||n.startsWith("url(")))},rr=function(t){return 1e3*t},ir={tween:pe,spring:ce,keyframes:function(t){var n,e,r,i,o=t.easings,a=t.ease,u=void 0===a?Gn:a,s=t.times,c=t.values,f=m(t,["easings","ease","times","values"]);o=Array.isArray(o)?o:(e=o,(n=c).map(function(){return e||$n}).splice(0,n.length-1)),s=s||(i=(r=c).length,r.map(function(t,n){return 0!==n?n/(i-1):0}));var l=o.map(function(t,n){return le({from:c[n],to:c[n+1],ease:t})});return pe(q({},f,{ease:u})).applyMiddleware(function(t){return n=l,e=t,i=(r=s).length,a=(o=i-1)-1,u=n.map(function(t){return t.start(e)}),function(t){t<=r[0]&&u[0].seek(0),t>=r[o]&&u[a].seek(1);for(var n=1;n<i&&!(r[n]>t||n===o);n++);var e=st(r[n-1],r[n],t);u[n-1].seek(ve(e))};var r,n,e,i,o,a,u})},inertia:fe,just:Te},or={tween:function(t){if(t.ease){var n=nr(t.ease)?t.ease[0]:t.ease;t.ease=tr(n)}return t},keyframes:function(t){var n=t.from,e=(t.to,t.velocity,m(t,["from","to","velocity"]));if(e.values&&null===e.values[0]){var r=e.values.slice();r[0]=n,e.values=r}return e.ease&&(e.easings=nr(e.ease)?e.ease.map(tr):tr(e.ease)),e.ease=Le,e}},ar=function(t,n,e){var r,i,o,a=e?e.delay:0;if(void 0===e||!function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection;var n=m(t,["when","delay","delayChildren","staggerChildren","staggerDirection"]);return Object.keys(n).length}(e))return q({delay:a},(r=t,o=Bn(i=n)?Se:Oe[r]||Oe.default,q({to:i},o(i))));var u=e[t]||e.default||e;return!1===u.type?{delay:u.hasOwnProperty("delay")?u.delay:a,to:Bn(n)?n[n.length-1]:n,type:"just"}:Bn(n)?q({values:n,duration:.8,delay:a,ease:"linear"},u,{type:"keyframes"}):q({type:"tween",to:n,delay:a},u)},ur=function(t,n,e,r){var i=n.get(),o=er(t,i),a=er(t,e);x(o===a,"You are trying to animate "+t+' from "'+i+'" to '+e+'. "'+i+'" is not an animatable value - to enable this animation set '+i+" to a value animatable to "+e+" via the `style` property.");var u,s,c,f=ar(t,e,r),l=f.type,d=void 0===l?"tween":l,p=m(f,["type"]),v=o&&a?ir[d]:Te,h=(u=d,s=q({from:i,velocity:n.getVelocity()},p),or[u]?or[u](s):s);return((c=h).hasOwnProperty("duration")||c.hasOwnProperty("repeatDelay"))&&(h.duration&&(h.duration=rr(h.duration)),h.repeatDelay&&(h.repeatDelay=rr(h.repeatDelay))),[v,h]};function sr(s,c,f,t){var n=t.delay,l=void 0===n?0:n,d=m(t,["delay"]);return c.start(function(n){var e,t=ur(s,c,f,d),r=t[0],i=t[1],o=i.delay,a=m(i,["delay"]);void 0!==o&&(l=o);var u=function(){var t=r(a);e=t.start({update:function(t){return c.set(t)},complete:n})};return l?e=we(rr(l)).start({complete:u}):u(),function(){e&&e.stop()}})}var cr=function(){function t(t){var e=this,n=t.values,r=t.readValueFromSource,i=t.makeTargetAnimatable;this.props={},this.variants={},this.baseTarget={},this.overrides=[],this.resolvedOverrides=[],this.activeOverrides=new Set,this.isAnimating=new Set,this.hasValue=function(t){return!e.values.has(t)},this.values=n,this.readValueFromSource=r,this.makeTargetAnimatable=i,this.values.forEach(function(t,n){return e.baseTarget[n]=t.get()})}return t.prototype.setProps=function(t){this.props=t},t.prototype.setVariants=function(t){t&&(this.variants=t)},t.prototype.setDefaultTransition=function(t){t&&(this.defaultTransition=t)},t.prototype.setValues=function(t,n){var r=this,e=void 0===n?{}:n,i=e.isActive,o=void 0===i?new Set:i,a=e.priority,u=(t.transition,t.transitionEnd),s=m(t,["transition","transitionEnd"]);return s=this.transformValues(q({},s,u)),Object.keys(s).forEach(function(t){if(!o.has(t)){o.add(t);var n=zn(s[t]);if(r.values.has(t)){var e=r.values.get(t);e&&e.set(n)}else r.values.set(t,Rt(n));a||(r.baseTarget[t]=n)}})},t.prototype.transformValues=function(t){var n=this.props.transformValues;return n?n(t):t},t.prototype.checkForNewValues=function(t){var n,e=Object.keys(t).filter(this.hasValue),r=e.length;if(r)for(var i=0;i<r;i++){var o=e[i],a=t[o],u=null;Array.isArray(a)&&(u=a[0]),null===u&&(u=this.readValueFromSource(o),E(null!==u,'No initial value for "'+o+'" can be inferred. Ensure an initial value for "'+o+'" is defined on the component.')),"string"==typeof u&&/^\d*\.?\d+$/.test(u)?u=parseFloat(u):(n=u,!Nn.find(Un(n))&&Q.test(a)&&(u=Q.getAnimatableNone(a))),this.values.set(o,Rt(u)),this.baseTarget[o]=u}},t.prototype.resolveVariant=function(t){if(!t)return{target:void 0,transition:void 0,transitionEnd:void 0};var n,e,r,i;"function"==typeof t&&(t=t(this.props.custom,(r=this.values,i={},r.forEach(function(t,n){return i[n]=t.get()}),i),(n=this.values,e={},n.forEach(function(t,n){return e[n]=t.getVelocity()}),e)));var o=t.transition;return{transition:void 0===o?this.defaultTransition:o,transitionEnd:t.transitionEnd,target:m(t,["transition","transitionEnd"])}},t.prototype.getHighestPriority=function(){return this.activeOverrides.size?Math.max.apply(Math,Array.from(this.activeOverrides)):0},t.prototype.setOverride=function(n,e){this.overrides[e]=n,this.children&&this.children.forEach(function(t){return t.setOverride(n,e)})},t.prototype.startOverride=function(t){var n=this.overrides[t];if(n)return this.start(n,{priority:t})},t.prototype.clearOverride=function(n){var t=this;if(this.children&&this.children.forEach(function(t){return t.clearOverride(n)}),this.overrides[n]){this.activeOverrides.delete(n);var e=this.getHighestPriority();if(this.resetIsAnimating(),e)this.overrides[e]&&this.startOverride(e);var r=this.resolvedOverrides[n];if(r){var i={};for(var o in this.baseTarget)void 0!==r[o]&&(i[o]=this.baseTarget[o]);this.onStart(),this.animate(i).then(function(){return t.onComplete()})}}},t.prototype.apply=function(t){return Array.isArray(t)?this.applyVariantLabels(t):"string"==typeof t?this.applyVariantLabels([t]):void this.setValues(t)},t.prototype.applyVariantLabels=function(i){var o=this,a=new Set;i.slice().reverse().forEach(function(t){var n=o.resolveVariant(o.variants[t]),e=n.target,r=n.transitionEnd;r&&o.setValues(r,{isActive:a}),e&&o.setValues(e,{isActive:a}),o.children&&o.children.size&&o.children.forEach(function(t){return t.applyVariantLabels(i)})})},t.prototype.start=function(t,n){var e,r,i=this;return void 0===n&&(n={}),n.priority&&this.activeOverrides.add(n.priority),this.resetIsAnimating(n.priority),r=t,e=Array.isArray(r)?this.animateVariantLabels(t,n):"string"==typeof t?this.animateVariant(t,n):this.animate(t,n),this.onStart(),e.then(function(){return i.onComplete()})},t.prototype.animate=function(t,n){var e=this,r=void 0===n?{}:n,i=r.delay,o=void 0===i?0:i,a=r.priority,u=void 0===a?0:a,s=r.transitionOverride,c=this.resolveVariant(t),f=c.target,l=c.transition,d=c.transitionEnd;if(s&&(l=s),!f)return Promise.resolve();if(f=this.transformValues(f),d&&(d=this.transformValues(d)),this.checkForNewValues(f),this.makeTargetAnimatable){var p=this.makeTargetAnimatable(f,d);f=p.target,d=p.transitionEnd}u&&(this.resolvedOverrides[u]=f),this.checkForNewValues(f);var v=[];for(var h in f){var m=this.values.get(h);if(m&&f&&void 0!==f[h]){var g=f[h];u||(this.baseTarget[h]=zn(g)),this.isAnimating.has(h)||(this.isAnimating.add(h),v.push(sr(h,m,g,q({delay:o},l))))}}var y=Promise.all(v);return d?y.then(function(){e.setValues(d,{priority:u})}):y},t.prototype.animateVariantLabels=function(t,n){var e=this,r=t.slice().reverse().map(function(t){return e.animateVariant(t,n)});return Promise.all(r)},t.prototype.animateVariant=function(t,n){var e=this,r=!1,i=0,o=0,a=1,u=n&&n.priority||0,s=this.variants[t],c=s?function(){return e.animate(s,n)}:function(){return Promise.resolve()},f=this.children?function(){return e.animateChildren(t,i,o,a,u)}:function(){return Promise.resolve()};if(s&&this.children){var l=this.resolveVariant(s).transition;l&&(r=l.when||r,i=l.delayChildren||i,o=l.staggerChildren||o,a=l.staggerDirection||a)}if(r){var d="beforeChildren"===r?[c,f]:[f,c],p=d[1];return(0,d[0])().then(p)}return Promise.all([c(),f()])},t.prototype.animateChildren=function(r,i,n,t,o){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===t&&(t=1),void 0===o&&(o=0),!this.children)return Promise.resolve();var a=[],e=(this.children.size-1)*n,u=1===t?function(t){return t*n}:function(t){return e-t*n};return Array.from(this.children).forEach(function(t,n){var e=t.animateVariant(r,{priority:o,delay:i+u(n)});a.push(e)}),Promise.all(a)},t.prototype.onStart=function(){var t=this.props.onAnimationStart;t&&t()},t.prototype.onComplete=function(){var t=this.props.onAnimationComplete;t&&t()},t.prototype.checkOverrideIsAnimating=function(t){for(var n=this.overrides.length,e=t+1;e<n;e++){var r=this.resolvedOverrides[e];if(r)for(var i in r)this.isAnimating.add(i)}},t.prototype.resetIsAnimating=function(n){void 0===n&&(n=0),this.isAnimating.clear(),n<this.getHighestPriority()&&this.checkOverrideIsAnimating(n),this.children&&this.children.forEach(function(t){return t.resetIsAnimating(n)})},t.prototype.stop=function(){this.values.forEach(function(t){return t.stop()})},t.prototype.addChild=function(e){this.children||(this.children=new Set),this.children.add(e),this.overrides.forEach(function(t,n){t&&e.setOverride(t,n)})},t.prototype.removeChild=function(t){this.children&&this.children.delete(t)},t.prototype.resetChildren=function(){this.children&&this.children.clear()},t}();var fr=function(){function t(){this.hasMounted=!1,this.pendingAnimations=[],this.componentControls=new Set}return t.prototype.setVariants=function(n){this.variants=n,this.componentControls.forEach(function(t){return t.setVariants(n)})},t.prototype.setDefaultTransition=function(n){this.defaultTransition=n,this.componentControls.forEach(function(t){return t.setDefaultTransition(n)})},t.prototype.subscribe=function(t){var n=this;return this.componentControls.add(t),this.variants&&t.setVariants(this.variants),this.defaultTransition&&t.setDefaultTransition(this.defaultTransition),function(){return n.componentControls.delete(t)}},t.prototype.start=function(e,r){var n=this;if(this.hasMounted){var i=[];return this.componentControls.forEach(function(t){var n=t.start(e,{transitionOverride:r});i.push(n)}),Promise.all(i)}return new Promise(function(t){n.pendingAnimations.push({animation:[e,r],resolve:t})})},t.prototype.set=function(n){return E(this.hasMounted,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),this.componentControls.forEach(function(t){return t.apply(n)})},t.prototype.stop=function(){this.componentControls.forEach(function(t){return t.stop()})},t.prototype.mount=function(){var r=this;this.hasMounted=!0,this.pendingAnimations.forEach(function(t){var n=t.animation,e=t.resolve;return r.start.apply(r,n).then(e)})},t.prototype.unmount=function(){this.hasMounted=!1,this.stop()},t}(),lr=W.createContext({static:!1}),dr=function(t){return"string"==typeof t||Array.isArray(t)},pr=function(t){return t instanceof fr},vr=function(n,e,t,r,i){void 0===r&&(r=!1);var o,a=i.initial,u=i.animate,s=i.variants,c=i.whileTap,f=i.whileHover;n.exitProps&&void 0!==n.exitProps.initial&&(a=n.exitProps.initial),!1!==a||pr(u)?"boolean"!=typeof a&&(o=a):o=u;var l,d,p=W.useRef(!1),v=s||dr(u)||dr(c)||dr(f)||pr(u),h=dr(o)?o:n.initial,m=dr(u)?u:n.animate,g=r?h:null,y=v&&dr(m)?m:null,b=W.useMemo(function(){return{controls:v?e:n.controls,initial:h,animate:m,values:t,hasMounted:p}},[g,y]);return b.static=r,l=function(){var t=o||n.initial;t&&e.apply(t)},void 0===(d=r?1/0:1)&&(d=1),W.useRef(0).current++<d&&l(),W.useEffect(function(){p.current=!0},[]),b};function hr(t,n,e,r){var i=n.variants,o=n.transition,a=W.useContext(lr).controls,u=Cn(function(){return new cr(t)});return r&&r.exitProps&&r.exitProps.isExiting||(u.resetChildren(),u.setProps(n),u.setVariants(i),u.setDefaultTransition(o),e&&a&&a.addChild(u)),W.useEffect(function(){return function(){n.onAnimationComplete;var t=m(n,["onAnimationComplete"]);u.setProps(t),a&&a.removeChild(u)}},[]),u}var mr,gr=function(t){var m=t.getValueControlsConfig,g=t.loadFunctionalityComponents,y=t.renderComponent;return W.forwardRef(function(t,n){var e,r,i,o,a=W.useRef(null),u=W.useContext(lr),s=u.static||t.static||!1,c=Pn(t),f=function(t,n,e,r){void 0===n&&(n={});var i,o={},a=W.useRef({}).current;for(var u in n){var s=n[u];Sn(s)?t.set(u,s):e||!qt(u)&&(i=u,!Hn.has(i))?o[u]=s:(t.has(u)?s!==a[u]&&t.get(u).set(s):t.set(u,Rt(s)),a[u]=s)}return r?r(o):o}(c,t.style,s,t.transformValues),l=(r=(e=t).animate,i=e.variants,(void 0===(o=e.inherit)||o)&&!!i&&(!r||r instanceof fr)),d=hr(Cn(function(){return m(a,c)}),t,l,u),p=vr(u,d,c,s,t),v=s?null:g(a,c,t,u,d,l),h=y(a,f,c,t,s);return W.createElement(W.Fragment,null,W.createElement(jn,{ref:a,externalRef:n,values:c,isStatic:s}),v,W.createElement(lr.Provider,{value:p},h))})},yr=["animate","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use","view"];(mr=w.Point||(w.Point={})).subtract=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},mr.relativeTo=function(o){var a;return function(t){var n=t.x,e=t.y,r=void 0!==a?a:a="string"==typeof o?document.getElementById(o):o;if(r){var i=r.getBoundingClientRect();return{x:n-i.left-window.scrollX,y:e-i.top-window.scrollY}}}};var br=W.createContext({transformPagePoint:function(t){return t}});var wr=!1;"undefined"!=typeof window&&document.addEventListener("touchmove",function(t){wr&&t.preventDefault()},{passive:!1});var xr=function(){return wr=!1};function Er(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function Cr(t){return!!t.touches}function Sr(t){return W.useEffect(function(){return function(){return t()}},[])}function Or(t,n,e,r){if(e)return t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e,r)}}function Tr(n,e,r,i){W.useEffect(function(){var t=n.current;if(r&&t)return Or(t,e,r,i)},[n,e,r,i])}var Ar={pageX:0,pageY:0};function Pr(t){return{point:Cr(t)?(o=t,a=o.touches[0]||o.changedTouches[0]||Ar,{x:a.pageX,y:a.pageY}):(n=t,e=n.pageX,r=void 0===e?0:e,i=n.pageY,{x:r,y:void 0===i?0:i})};var n,e,r,i,o,a}var Rr=function(n,t){if(void 0===t&&(t=!1),n){var e=function(t){return n(t,Pr(t))};return t?function(e){if(e)return function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}}(e):e}},Mr="undefined"!=typeof window,kr=function(){return Mr&&null===window.onpointerdown},Vr=function(){return Mr&&null===window.ontouchstart},Dr=function(){return Mr&&null===window.onmousedown},Lr={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Xr={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Yr(t){return kr()?t:Vr()?Xr[t]:Dr()?Lr[t]:t}function jr(t,n,e,r){return Or(t,Yr(n),Rr(e,"pointerdown"===n),r)}function Fr(t,n,e,r){return Tr(t,Yr(n),Rr(e,"pointerdown"===n),r)}function Hr(t){return t.pointHistory[t.pointHistory.length-1]}function Br(t,n){var e=t.onPan,r=t.onPanStart,i=t.onPanEnd,o=t.onPanSessionStart,a=e||r||i||o,u=W.useRef(null),s=W.useRef(null),c=W.useRef(null),f=W.useContext(br).transformPagePoint,l=W.useRef(null),d=W.useRef({}).current;function p(){l.current&&l.current(),l.current=null}function v(t){var n,e=t.point,r=u.current;return{point:e,delta:w.Point.subtract(e,Hr(r)),offset:w.Point.subtract(e,(n=r,n.pointHistory[0])),velocity:function(t,n){var e=t.pointHistory;if(e.length<2)return{x:0,y:0};for(var r=e.length-1,i=null,o=Hr(t);0<=r&&(i=e[r],!(o.timestamp-i.timestamp>rr(n)));)r--;if(!i)return{x:0,y:0};var a=(o.timestamp-i.timestamp)/1e3;if(0===a)return{x:0,y:0};var u={x:(o.x-i.x)/a,y:(o.y-i.y)/a};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}(r,.1)}}function h(t){return{point:f(t.point)}}function m(){p(),j.update(g),xr()}function g(){if(!u.current||!s.current||!c.current)return x(!1,"onPointerMove fired without pointer session"),void m();var t=v(c.current),n=void 0!==u.current.startEvent,e=3<=ut(t.offset,{x:0,y:0});if(n||e){var r=t.point,i=S().timestamp;u.current.pointHistory.push(q({},r,{timestamp:i})),n||(d.onPanStart&&d.onPanStart(s.current,t),u.current.startEvent=s.current),d.onPan&&d.onPan(s.current,t)}}function y(t,n){s.current=t,c.current=h(n),Er(t)&&0===t.buttons?b(t,n):Y.update(g,!0)}function b(t,n){m(),u.current?(d.onPanEnd&&d.onPanEnd(t,v(h(n))),u.current=null):x(!1,"onPointerUp fired without pointer session")}d.onPanSessionStart=o,d.onPanStart=r,d.onPan=e,d.onPanEnd=i,Fr(n,"pointerdown",a&&function(t,n){if(!(Cr(t)&&1<t.touches.length)){var e=h(n),r=e.point,i=S().timestamp;u.current={target:t.target,pointHistory:[q({},r,{timestamp:i})]},d.onPanSessionStart&&d.onPanSessionStart(t,v(e)),p();var o=jr(window,"pointermove",y),a=jr(window,"pointerup",b);l.current=function(){o&&o(),a&&a()}}}),Sr(m)}var zr=function(t,n){return!!n&&(t===n||zr(t,n.parentElement))},Ir=["whileHover","whileTap","whileDrag"],Nr=function(t){return Ir.indexOf(t)+1};function Ur(t){var n=null;return function(){return null===n&&(n=t,function(){n=nu