react-pose
Version:
A declarative animation library for React
1 lines • 63.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):e(t.React)}(this,function(t){"use strict";var e="default"in t?t.default:t,r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function a(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var u=function(){return(u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},s=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},c=function(t){return t%1?Number(t.toFixed(5)):t},f=/(-)?(\d[\d\.]*)/g,p=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,l=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,d={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},h=u(u({},d),{transform:s(0,1)}),v=u(u({},d),{default:1}),m=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},g=m("deg"),y=m("%"),b=m("px"),P=m("vh"),w=m("vw"),x=u(u({},y),{parse:function(t){return y.parse(t)/100},transform:function(t){return y.transform(100*t)}}),C=s(0,255),O=function(t){return void 0!==t.red},S=function(t){return void 0!==t.hue},A=function(t){return function(e){if("string"!=typeof e)return e;for(var r,n={},o=(r=e,r.substring(r.indexOf("(")+1,r.lastIndexOf(")"))).split(/,\s*/),i=0;i<4;i++)n[t[i]]=void 0!==o[i]?parseFloat(o[i]):1;return n}},k=u(u({},d),{transform:function(t){return Math.round(C(t))}});function E(t,e){return t.startsWith(e)&&l.test(t)}var M,V={test:function(t){return"string"==typeof t?E(t,"rgb"):O(t)},parse:A(["red","green","blue","alpha"]),transform:function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return"rgba("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({red:k.transform(e),green:k.transform(r),blue:k.transform(n),alpha:c(h.transform(i))})}},T={test:function(t){return"string"==typeof t?E(t,"hsl"):S(t)},parse:A(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return"hsla("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:y.transform(c(r)),lightness:y.transform(c(n)),alpha:c(h.transform(i))})}},R=u(u({},V),{test:function(t){return"string"==typeof t&&E(t,"#")},parse:function(t){var e="",r="",n="";return t.length>4?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),e+=e,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),D={test:function(t){return"string"==typeof t&&l.test(t)||O(t)||S(t)},parse:function(t){return V.test(t)?V.parse(t):T.test(t)?T.parse(t):R.test(t)?R.parse(t):t},transform:function(t){return O(t)?V.transform(t):S(t)?T.transform(t):t}},F=function(t){return"number"==typeof t?0:t},j={test:function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,r=t.match(f),n=t.match(p);return r&&(e+=r.length),n&&(e+=n.length),e>0},parse:function(t){var e=t,r=[],n=e.match(p);n&&(e=e.replace(p,"${c}"),r.push.apply(r,n.map(D.parse)));var o=e.match(f);return o&&r.push.apply(r,o.map(d.parse)),r},createTransformer:function(t){var e=t,r=0,n=t.match(p),o=n?n.length:0;if(n)for(var i=0;i<o;i++)e=e.replace(n[i],"${c}"),r++;var a=e.match(f),u=a?a.length:0;if(a)for(i=0;i<u;i++)e=e.replace(a[i],"${n}"),r++;return function(t){for(var n=e,i=0;i<r;i++)n=n.replace(i<o?"${c}":"${n}",i<o?D.transform(t[i]):c(t[i]));return n}},getAnimatableNone:function(t){var e=j.parse(t);return j.createTransformer(t)(e.map(F))}},L=function(){},I=function(){},B=0,X="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),r=Math.max(0,16.7-(e-B));B=e+r,setTimeout(function(){return t(B)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(M||(M={}));var Y=1/60*1e3,z=!0,U=!1,H=!1,W={delta:0,timestamp:0},N=[M.Read,M.Update,M.Render,M.PostRender],q=function(t){return U=t},_=N.reduce(function(t,e){var r,n,o,i,a,u,s,c,f,p=(r=q,n=[],o=[],i=0,a=!1,u=0,s=new WeakSet,c=new WeakSet,f={cancel:function(t){var e=o.indexOf(t);s.add(t),-1!==e&&o.splice(e,1)},process:function(t){var e,p;if(a=!0,n=(e=[o,n])[0],(o=e[1]).length=0,i=n.length)for(u=0;u<i;u++)(p=n[u])(t),!0!==c.has(p)||s.has(p)||(f.schedule(p),r(!0));a=!1},schedule:function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var u=r&&a,f=u?n:o;s.delete(t),e&&c.add(t),-1===f.indexOf(t)&&(f.push(t),u&&(i=n.length))}});return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),U||Q(),p.schedule(t,e,r),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),Z=_.steps,$=_.sync,G=_.cancelSync,K=function(t){return Z[t].process(W)},J=function(t){U=!1,W.delta=z?Y:Math.max(Math.min(t-W.timestamp,40),1),z||(Y=W.delta),W.timestamp=t,H=!0,N.forEach(K),H=!1,U&&(z=!1,X(J))},Q=function(){U=!0,z=!0,H||X(J)},tt=function(){return W},et=function(t){return function(e){return 1-t(1-e)}},rt=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},nt=et,ot=function(t){return function(e){return e*e*((t+1)*e-t)}},it=function(t){return t},at=function(t){return function(e){return Math.pow(e,t)}}(2),ut=et(at),st=rt(at),ct=function(t){return 1-Math.sin(Math.acos(t))},ft=et(ct),pt=rt(ft),lt=ot(1.525),dt=et(lt),ht=rt(lt),vt=function(t){var e=ot(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),mt=8,gt=.001,yt=1e-7,bt=10,Pt=11,wt=1/(Pt-1),xt="undefined"!=typeof Float32Array,Ct=function(t,e){return 1-3*e+3*t},Ot=function(t,e){return 3*e-6*t},St=function(t){return 3*t},At=function(t,e,r){return 3*Ct(e,r)*t*t+2*Ot(e,r)*t+St(e)},kt=function(t,e,r){return((Ct(e,r)*t+Ot(e,r))*t+St(e))*t};function Et(t,e,r,n){var o=xt?new Float32Array(Pt):new Array(Pt),i=function(e){for(var n,i,a,u=0,s=1,c=Pt-1;s!==c&&o[s]<=e;++s)u+=wt;return n=(e-o[--s])/(o[s+1]-o[s]),(a=At(i=u+n*wt,t,r))>=gt?function(e,n){for(var o=0,i=0;o<mt;++o){if(0===(i=At(n,t,r)))return n;n-=(kt(n,t,r)-e)/i}return n}(e,i):0===a?i:function(e,n,o){var i,a,u=0;do{(i=kt(a=n+(o-n)/2,t,r)-e)>0?o=a:n=a}while(Math.abs(i)>yt&&++u<bt);return a}(e,u,u+wt)};!function(){for(var e=0;e<Pt;++e)o[e]=kt(e*wt,t,r)}();return function(o){return t===e&&r===n?o:0===o?0:1===o?1:kt(i(o),e,n)}}var Mt={x:0,y:0,z:0},Vt=function(t){return"number"==typeof t},Tt=function(t){return 180*t/Math.PI},Rt=function(t,e){return void 0===e&&(e=Mt),Tt(Math.atan2(e.y-t.y,e.x-t.x))},Dt=function(t,e){var r=!0;return void 0===e&&(e=t,r=!1),function(n){return r?n-t+e:(t=n,r=!0,e)}},Ft=function(t){return function(e,r,n){return void 0!==n?t(e,r,n):function(n){return t(e,r,n)}}},jt=Ft(function(t,e,r){return Math.min(Math.max(r,t),e)}),Lt=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},It=function(t){return Lt(t)&&t.hasOwnProperty("z")},Bt=function(t,e){return Math.abs(t-e)},Xt=function(t,e){if(void 0===e&&(e=Mt),Vt(t)&&Vt(e))return Bt(t,e);if(Lt(t)&&Lt(e)){var r=Bt(t.x,e.x),n=Bt(t.y,e.y),o=It(t)&&It(e)?Bt(t.z,e.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}return 0},Yt=function(t,e,r){var n=e-t;return 0===n?1:(r-t)/n},zt=function(t,e,r){return-r*t+r*e+t},Ut=function(){return(Ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e,r){var n=t*t,o=e*e;return Math.sqrt(Math.max(0,r*(o-n)+n))},Wt=[R,V,T],Nt=function(t){return Wt.find(function(e){return e.test(t)})},qt=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},_t=function(t,e){var r=Nt(t),n=Nt(e);L(!!r,qt(t)),L(!!n,qt(e)),L(r.transform===n.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var o=r.parse(t),i=n.parse(e),a=Ut({},o),u=r===T?zt:Ht;return function(t){for(var e in a)"alpha"!==e&&(a[e]=u(o[e],i[e],t));return a.alpha=zt(o.alpha,i.alpha,t),r.transform(a)}},Zt=function(t,e){return function(r){return e(t(r))}},$t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Zt)};function Gt(t,e){return Vt(t)?function(r){return zt(t,e,r)}:D.test(t)?_t(t,e):te(t,e)}var Kt=function(t,e){var r=t.slice(),n=r.length,o=t.map(function(t,r){return Gt(t,e[r])});return function(t){for(var e=0;e<n;e++)r[e]=o[e](t);return r}},Jt=function(t,e){var r=Ut({},t,e),n={};for(var o in r)void 0!==t[o]&&void 0!==e[o]&&(n[o]=Gt(t[o],e[o]));return function(t){for(var e in n)r[e]=n[e](t);return r}};function Qt(t){for(var e=j.parse(t),r=e.length,n=0,o=0,i=0,a=0;a<r;a++)n||"number"==typeof e[a]?n++:void 0!==e[a].hue?i++:o++;return{parsed:e,numNumbers:n,numRGB:o,numHSL:i}}var te=function(t,e){var r=j.createTransformer(e),n=Qt(t),o=Qt(e);return L(n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),$t(Kt(n.parsed,o.parsed),r)},ee=function(t,e){return function(r){return zt(t,e,r)}};function re(t,e,r){for(var n,o=[],i=r||("number"==typeof(n=t[0])?ee:"string"==typeof n?D.test(n)?_t:te:Array.isArray(n)?Kt:"object"==typeof n?Jt:void 0),a=t.length-1,u=0;u<a;u++){var s=i(t[u],t[u+1]);if(e){var c=Array.isArray(e)?e[u]:e;s=$t(c,s)}o.push(s)}return o}var ne,oe=function(t,e,r,n){return void 0===n&&(n=0),o=t+r*(e-t)/Math.max(n,r),void 0===i&&(i=2),i=Math.pow(10,i),Math.round(o*i)/i;var o,i},ie=function(t){return t},ae=function(t){return void 0===t&&(t=ie),Ft(function(e,r,n){var o=r-n,i=-(0-e+1)*(0-t(Math.abs(o)));return o<=0?r+i:r-i})},ue=ae(),se=ae(Math.sqrt),ce=function(t,e){return Vt(t)?t/(1e3/e):0},fe=function(t,e){return e?t*(1e3/e):0},pe=Ft(function(t,e,r){var n=e-t;return((r-t)%n+n)%n+t}),le=(jt(0,1),function(t){var e=t.onRead,r=t.onRender,n=t.uncachedValues,o=void 0===n?new Set:n,a=t.useCache,u=void 0===a||a;return function(t){void 0===t&&(t={});var n=i(t,[]),a={},s=[],c=!1;function f(t,e){t.startsWith("--")&&(n.hasCSSVariable=!0);var r=a[t];a[t]=e,a[t]!==r&&(-1===s.indexOf(t)&&s.push(t),c||(c=!0,$.render(p.render)))}var p={get:function(t,r){return void 0===r&&(r=!1),!r&&u&&!o.has(t)&&void 0!==a[t]?a[t]:e(t,n)},set:function(t,e){if("string"==typeof t)f(t,e);else for(var r in t)f(r,t[r]);return this},render:function(t){return void 0===t&&(t=!1),(c||!0===t)&&(r(a,n,s),c=!1,s.length=0),this}};return p}}),de=/([a-z])([A-Z])/g,he=function(t){return t.replace(de,"$1-$2").toLowerCase()},ve=new Map,me=new Map,ge=["Webkit","Moz","O","ms",""],ye=ge.length,be="undefined"!=typeof document,Pe=function(t,e){return me.set(t,he(e))},we=function(t,e){void 0===e&&(e=!1);var r=e?me:ve;return r.has(t)||(be?function(t){ne=ne||document.createElement("div");for(var e=0;e<ye;e++){var r=ge[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);if(o in ne.style||n){if(n&&"clipPath"===t&&me.has(t))return;ve.set(t,o),Pe(t,(n?"":"-")+he(o))}}}(t):function(t){Pe(t,t)}(t)),r.get(t)||t},xe=["","X","Y","Z"],Ce=["translate","scale","rotate","skew","transformPerspective"].reduce(function(t,e){return xe.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),Oe=Ce.reduce(function(t,e){return t[e]=!0,t},{});function Se(t){return!0===Oe[t]}function Ae(t,e){return Ce.indexOf(t)-Ce.indexOf(e)}var ke=new Set(["originX","originY","originZ"]);function Ee(t){return ke.has(t)}var Me=o(o({},d),{transform:Math.round}),Ve={color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,borderWidth:b,borderTopWidth:b,borderRightWidth:b,borderBottomWidth:b,borderLeftWidth:b,borderRadius:b,radius:b,borderTopLeftRadius:b,borderTopRightRadius:b,borderBottomRightRadius:b,borderBottomLeftRadius:b,width:b,maxWidth:b,height:b,maxHeight:b,size:b,top:b,right:b,bottom:b,left:b,padding:b,paddingTop:b,paddingRight:b,paddingBottom:b,paddingLeft:b,margin:b,marginTop:b,marginRight:b,marginBottom:b,marginLeft:b,rotate:g,rotateX:g,rotateY:g,rotateZ:g,scale:v,scaleX:v,scaleY:v,scaleZ:v,skew:g,skewX:g,skewY:g,distance:b,translateX:b,translateY:b,translateZ:b,x:b,y:b,z:b,perspective:b,opacity:h,originX:x,originY:x,originZ:b,zIndex:Me,fillOpacity:h,strokeOpacity:h,numOctaves:Me},Te=function(t){return Ve[t]},Re=function(t,e){return e&&"number"==typeof t?e.transform(t):t},De="scrollLeft",Fe="scrollTop",je=new Set([De,Fe]),Le=new Set([De,Fe,"transform"]),Ie={x:"translateX",y:"translateY",z:"translateZ"};function Be(t){return"function"==typeof t}function Xe(t,e,r,n,o,i,a){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===a&&(a=!1);var u=!0,s=!1,c=!1;for(var f in t){var p=t[f],l=Te(f),d=Re(p,l);Se(f)?(s=!0,n[f]=d,i.push(f),u&&(l.default&&p!==l.default||!l.default&&0!==p)&&(u=!1)):Ee(f)?(o[f]=d,c=!0):Le.has(f)&&Be(d)||(r[we(f,a)]=d)}return(s||"function"==typeof t.transform)&&(r.transform=function(t,e,r,n,o){var i="",a=!1;r.sort(Ae);for(var u=r.length,s=0;s<u;s++){var c=r[s];i+=(Ie[c]||c)+"("+e[c]+") ",a="z"===c||a}return!a&&o?i+="translateZ(0)":i=i.trim(),Be(t.transform)?i=t.transform(e,i):n&&(i="none"),i}(t,n,i,u,e)),c&&(r.transformOrigin=(o.originX||"50%")+" "+(o.originY||"50%")+" "+(o.originZ||0)),r}function Ye(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var r={},n={},o={},i=[];return function(a){return i.length=0,Xe(a,t,r,n,o,i,e),r}}var ze=le({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=Te(t);if(Se(t))return o&&o.default||0;if(je.has(t))return r[t];var i=window.getComputedStyle(r,null).getPropertyValue(we(t,!0))||0;return n&&o&&o.test(i)&&o.parse?o.parse(i):i},onRender:function(t,e,r){var n=e.element,o=e.buildStyles,i=e.hasCSSVariable;if(Object.assign(n.style,o(t)),i)for(var a=r.length,u=0;u<a;u++){var s=r[u];s.startsWith("--")&&n.style.setProperty(s,t[s])}-1!==r.indexOf(De)&&(n[De]=t[De]),-1!==r.indexOf(Fe)&&(n[Fe]=t[Fe])},uncachedValues:je});var Ue=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),He=.5,We=function(){return{style:{}}},Ne=function(t,e){return b.transform(t*e)},qe={x:0,y:0,width:0,height:0};function _e(t,e,r){return"string"==typeof t?t:b.transform(e+r*t)}function Ze(t,e,r,n,o,a){void 0===e&&(e=qe),void 0===n&&(n=Ye(!1,!1)),void 0===o&&(o=We()),void 0===a&&(a=!0);var u=t.attrX,s=t.attrY,c=t.originX,f=t.originY,p=t.pathLength,l=t.pathSpacing,d=void 0===l?1:l,h=t.pathOffset,v=void 0===h?0:h,m=n(i(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var g in m){if("transform"===g)o.style.transform=m[g];else o[a&&!Ue.has(g)?he(g):g]=m[g]}return(void 0!==c||void 0!==f||m.transform)&&(o.style.transformOrigin=function(t,e,r){return _e(e,t.x,t.width)+" "+_e(r,t.y,t.height)}(e,void 0!==c?c:He,void 0!==f?f:He)),void 0!==u&&(o.x=u),void 0!==s&&(o.y=s),void 0!==r&&void 0!==p&&(o[a?"stroke-dashoffset":"strokeDashoffset"]=Ne(-v,r),o[a?"stroke-dasharray":"strokeDasharray"]=Ne(p,r)+" "+Ne(d,r)),o}var $e=le({onRead:function(t,e){var r=e.element;if(Se(t=Ue.has(t)?t:he(t))){var n=Te(t);return n&&n.default||0}return r.getAttribute(t)},onRender:function(t,e){var r=e.element,n=(0,e.buildAttrs)(t);for(var o in n)"style"===o?Object.assign(r.style,n.style):r.setAttribute(o,n[o])}}),Ge=function(t){var e=function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),r=function(t){return"path"===t.tagName}(t)&&t.getTotalLength?t.getTotalLength():void 0;return $e({element:t,buildAttrs:function(t,e,r){void 0===r&&(r=!0);var n=We(),o=Ye(!1,!1);return function(i){return Ze(i,t,e,o,n,r)}}(e,r)})},Ke=le({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,r=void 0===e?0:e,n=t.scrollLeft,o=void 0===n?0:n;return window.scrollTo(o,r)}}),Je=new WeakMap,Qe=function(t,e){var r;return t instanceof HTMLElement?r=function(t,e){void 0===e&&(e={});var r=e.enableHardwareAcceleration,n=i(e,["enableHardwareAcceleration"]);return ze(o({element:t,buildStyles:Ye(r),preparseOutput:!0},n))}(t,e):t instanceof SVGElement?r=Ge(t):t===window&&(r=Ke(t)),Je.set(t,r),r},tr=function(t,e){return Je.has(t)?Je.get(t):Qe(t,e)};var er=function(){function t(t){void 0===t&&(t={}),this.props=t}return t.prototype.applyMiddleware=function(t){return this.create(o({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=1===t.length?t[0]:$t.apply(void 0,t);return this.applyMiddleware(function(t){return function(e){return t(r(e))}})},t.prototype.while=function(t){return this.applyMiddleware(function(e,r){return function(n){return t(n)?e(n):r()}})},t.prototype.filter=function(t){return this.applyMiddleware(function(e){return function(r){return t(r)&&e(r)}})},t}(),rr=function(){return function(t,e){var r=t.middleware,n=t.onComplete,o=this;this.isActive=!0,this.update=function(t){o.observer.update&&o.updateObserver(t)},this.complete=function(){o.observer.complete&&o.isActive&&o.observer.complete(),o.onComplete&&o.onComplete(),o.isActive=!1},this.error=function(t){o.observer.error&&o.isActive&&o.observer.error(t),o.isActive=!1},this.observer=e,this.updateObserver=function(t){return e.update(t)},this.onComplete=n,e.update&&r&&r.length&&r.forEach(function(t){return o.updateObserver=t(o.updateObserver,o.complete)})}}(),nr=function(t,e,r){var n=e.middleware;return new rr({middleware:n,onComplete:r},"function"==typeof t?{update:t}:t)},or=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.start=function(t){void 0===t&&(t={});var e=!1,r={stop:function(){}},n=this.props,a=n.init,u=i(n,["init"]),s=a(nr(t,u,function(){e=!0,r.stop()}));return r=s?o({},r,s):r,t.registerParent&&t.registerParent(r),e&&r.stop(),r},e}(er),ir=function(t){return new or({init:t})},ar=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subscribers=[],e}return n(e,t),e.prototype.complete=function(){this.subscribers.forEach(function(t){return t.complete()})},e.prototype.error=function(t){this.subscribers.forEach(function(e){return e.error(t)})},e.prototype.update=function(t){for(var e=0;e<this.subscribers.length;e++)this.subscribers[e].update(t)},e.prototype.subscribe=function(t){var e=this,r=nr(t,this.props);return this.subscribers.push(r),{unsubscribe:function(){var t=e.subscribers.indexOf(r);-1!==t&&e.subscribers.splice(t,1)}}},e.prototype.stop=function(){this.parent&&this.parent.stop()},e.prototype.registerParent=function(t){this.stop(),this.parent=t},e}(er),ur=function(t,e){var r=1/(t-1),n=1/(2*(t-1)),o=Math.min(e,1)/n;return Math.floor((o+1)/2)*r},sr=function(t){return Array.isArray(t)},cr=function(t){var e=typeof t;return"string"===e||"number"===e},fr=function(t){function e(e){var r=t.call(this,e)||this;return r.scheduleVelocityCheck=function(){return $.postRender(r.velocityCheck)},r.velocityCheck=function(t){t.timestamp!==r.lastUpdated&&(r.prev=r.current)},r.prev=r.current=e.value||0,cr(r.current)?(r.updateCurrent=function(t){return r.current=t},r.getVelocityOfCurrent=function(){return r.getSingleVelocity(r.current,r.prev)}):sr(r.current)?(r.updateCurrent=function(t){return r.current=t.slice()},r.getVelocityOfCurrent=function(){return r.getListVelocity()}):(r.updateCurrent=function(t){for(var e in r.current={},t)t.hasOwnProperty(e)&&(r.current[e]=t[e])},r.getVelocityOfCurrent=function(){return r.getMapVelocity()}),e.initialSubscription&&r.subscribe(e.initialSubscription),r}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},e.prototype.update=function(e){t.prototype.update.call(this,e),this.prev=this.current,this.updateCurrent(e);var r=tt(),n=r.delta,o=r.timestamp;this.timeDelta=n,this.lastUpdated=o,$.postRender(this.scheduleVelocityCheck)},e.prototype.subscribe=function(e){var r=t.prototype.subscribe.call(this,e);return this.subscribers[this.subscribers.length-1].update(this.current),r},e.prototype.getSingleVelocity=function(t,e){return"number"==typeof t&&"number"==typeof e?fe(t-e,this.timeDelta):fe(parseFloat(t)-parseFloat(e),this.timeDelta)||0},e.prototype.getListVelocity=function(){var t=this;return this.current.map(function(e,r){return t.getSingleVelocity(e,t.prev[r])})},e.prototype.getMapVelocity=function(){var t={};for(var e in this.current)this.current.hasOwnProperty(e)&&(t[e]=this.getSingleVelocity(this.current[e],this.prev[e]));return t},e}(ar),pr=function(t,e){return new fr({value:t,initialSubscription:e})},lr=function(t){var e=t.getCount,r=t.getFirst,n=t.getOutput,o=t.mapApi,i=t.setProp,a=t.startActions;return function(t){return ir(function(u){var s=u.update,c=u.complete,f=u.error,p=e(t),l=n(),d=function(){return s(l)},h=0,v=a(t,function(t,e){var r=!1;return t.start({complete:function(){r||(r=!0,++h===p&&$.update(c))},error:f,update:function(t){i(l,e,t),$.update(d,!1,!0)}})});return Object.keys(r(v)).reduce(function(t,e){return t[e]=o(v,e),t},{})})}},dr=lr({getOutput:function(){return{}},getCount:function(t){return Object.keys(t).length},getFirst:function(t){return t[Object.keys(t)[0]]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Object.keys(t).reduce(function(n,o){var i;return t[o][e]&&(r[0]&&void 0!==r[0][o]?n[o]=t[o][e](r[0][o]):n[o]=(i=t[o])[e].apply(i,r)),n},{})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return Object.keys(t).reduce(function(r,n){return r[n]=e(t[n],n),r},{})}}),hr=lr({getOutput:function(){return[]},getCount:function(t){return t.length},getFirst:function(t){return t[0]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.map(function(t,n){if(t[e])return Array.isArray(r[0])?t[e](r[0][n]):t[e].apply(t,r)})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return t.map(function(t,r){return e(t,r)})}}),vr=[b,y,g,P,w],mr=function(t){return vr.find(function(e){return e.test(t)})},gr=function(t,e){return t(e)},yr=function(t,e,r){var n=r[0],i=e[n].map(function(n,i){var a=r.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(i),o({},e));return Sr(n)(t,a)});return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return hr(t)}.apply(void 0,i)},br=function(t,e,r){var n=r[0],i=Object.keys(e[n]).reduce(function(i,a){var u=r.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(a),o({},e));return i[a]=Sr(e[n][a])(t,u),i},{});return dr(i)},Pr=function(t,e){var r=e.from,n=e.to,a=i(e,["from","to"]),u=mr(r)||mr(n),s=u.transform,c=u.parse;return t(o({},a,{from:"string"==typeof r?c(r):r,to:"string"==typeof n?c(n):n})).pipe(s)},wr=function(t){return function(e,r){var n=r.from,a=r.to,u=i(r,["from","to"]);return e(o({},u,{from:0,to:1})).pipe(t(n,a))}},xr=wr(_t),Cr=wr(te),Or=function(t,e){var r=function(t){var e=Object.keys(t),r=function(e,r){return void 0!==e&&!t[r](e)};return{getVectorKeys:function(t){return e.reduce(function(e,n){return r(t[n],n)&&e.push(n),e},[])},testVectorProps:function(t){return t&&e.some(function(e){return r(t[e],e)})}}}(e),n=r.testVectorProps,o=r.getVectorKeys;return function(e){if(!n(e))return t(e);var r=o(e),i=e[r[0]];return Sr(i)(t,e,r)}},Sr=function(t){return"number"==typeof t?gr:Array.isArray(t)?yr:function(t){return Boolean(mr(t))}(t)?Pr:D.test(t)?xr:j.test(t)?Cr:"object"==typeof t?br:gr},Ar=Or(function(t){return void 0===t&&(t={}),ir(function(e){var r=e.complete,n=e.update,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,s=t.power,c=void 0===s?.8:s,f=t.timeConstant,p=void 0===f?350:f,l=t.restDelta,d=void 0===l?.5:l,h=t.modifyTarget,v=0,m=c*i,g=Math.round(u+m),y=void 0===h?g:h(g),b=$.update(function(t){var e=t.delta;v+=e;var o=-m*Math.exp(-v/p),i=o>d||o<-d;n(i?y+o:y),i||(G.update(b),r())},!0);return{stop:function(){return G.update(b)}}})},{from:d.test,modifyTarget:function(t){return"function"==typeof t},velocity:d.test}),kr=Or(function(t){return void 0===t&&(t={}),ir(function(e){var r=e.update,n=e.complete,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,s=t.to,c=void 0===s?0:s,f=t.stiffness,p=void 0===f?100:f,l=t.damping,d=void 0===l?10:l,h=t.mass,v=void 0===h?1:h,m=t.restSpeed,g=void 0===m?.01:m,y=t.restDelta,b=void 0===y?.01:y,P=i?-i/1e3:0,w=0,x=c-u,C=u,O=C,S=$.update(function(t){var e=t.delta;w+=e;var o=d/(2*Math.sqrt(p*v)),a=Math.sqrt(p/v)/1e3;if(O=C,o<1){var u=Math.exp(-o*a*w),s=a*Math.sqrt(1-o*o);C=c-u*((P+o*a*x)/s*Math.sin(s*w)+x*Math.cos(s*w))}else u=Math.exp(-a*w),C=c-u*(x+(P+a*x)*w);i=fe(C-O,e);var f=Math.abs(i)<=g,l=Math.abs(c-C)<=b;f&&l?(r(C=c),G.update(S),n()):r(C)},!0);return{stop:function(){return G.update(S)}}})},{from:d.test,to:d.test,stiffness:d.test,damping:d.test,mass:d.test,velocity:d.test}),Er=Or(function(t){var e=t.from,r=void 0===e?0:e,n=t.to,o=void 0===n?1:n,i=t.ease,a=void 0===i?it:i,u=t.reverseEase;return void 0!==u&&u&&(a=nt(a)),ir(function(t){var e=t.update;return{seek:function(t){return e(t)}}}).pipe(a,function(t){return zt(r,o,t)})},{ease:function(t){return"function"==typeof t},from:d.test,to:d.test}),Mr=jt(0,1),Vr=function(t){return void 0===t&&(t={}),ir(function(e){var r,n=e.update,o=e.complete,i=t.duration,a=void 0===i?300:i,u=t.ease,s=void 0===u?ut:u,c=t.flip,f=void 0===c?0:c,p=t.loop,l=void 0===p?0:p,d=t.yoyo,h=void 0===d?0:d,v=t.repeatDelay,m=void 0===v?0:v,g=t.from,y=void 0===g?0:g,b=t.to,P=void 0===b?1:b,w=t.elapsed,x=void 0===w?0:w,C=t.flipCount,O=void 0===C?0:C,S=t.yoyoCount,A=void 0===S?0:S,k=t.loopCount,E=void 0===k?0:k,M=Er({from:y,to:P,ease:s}).start(n),V=0,T=!1,R=function(t){var e;void 0===t&&(t=!1),M=Er({from:y=(e=[P,y])[0],to:P=e[1],ease:s,reverseEase:t}).start(n)},D=function(){V=Mr(Yt(0,a,x)),M.seek(V)},F=function(){T=!0,r=$.update(function(t){var e,n=t.delta;x+=n,D(),!(e=T&&x>a+m)||(!e||l||f||h)&&(x=a-(x-m),l&&E<l?(E++,1):f&&O<f?(O++,R(),1):h&&A<h&&(R(++A%2!=0),1))||(G.update(r),o&&$.update(o,!1,!0))},!0)},j=function(){T=!1,r&&G.update(r)};return F(),{isActive:function(){return T},getElapsed:function(){return jt(0,a,x)},getProgress:function(){return V},stop:function(){j()},pause:function(){return j(),this},resume:function(){return T||F(),this},seek:function(t){return x=zt(0,a,t),$.update(D,!1,!0),this},reverse:function(){return R(),this}}})},Tr=jt(0,1),Rr=Or(function(t){return void 0===t&&(t={}),ir(function(e){var r=e.complete,n=e.update,o=t.acceleration,i=void 0===o?0:o,a=t.friction,u=void 0===a?0:a,s=t.velocity,c=void 0===s?0:s,f=t.springStrength,p=t.to,l=t.restSpeed,d=void 0===l?.001:l,h=t.from,v=void 0===h?0:h,m=$.update(function(t){var e=t.delta,o=Math.max(e,16);i&&(c+=ce(i,o)),u&&(c*=Math.pow(1-u,o/100)),void 0!==f&&void 0!==p&&(c+=(p-v)*ce(f,o)),v+=ce(c,o),n(v),!1!==d&&(!c||Math.abs(c)<=d)&&(G.update(m),r())},!0);return{set:function(t){return v=t,this},setAcceleration:function(t){return i=t,this},setFriction:function(t){return u=t,this},setSpringStrength:function(t){return f=t,this},setSpringTarget:function(t){return p=t,this},setVelocity:function(t){return c=t,this},stop:function(){return G.update(m)}}})},{acceleration:d.test,friction:d.test,velocity:d.test,from:d.test,to:d.test,springStrength:d.test}),Dr=function(t,e,r){return ir(function(n){var o=n.update,i=e.split(" ").map(function(e){return t.addEventListener(e,o,r),e});return{stop:function(){return i.forEach(function(e){return t.removeEventListener(e,o,r)})}}})},Fr=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},jr=[{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}],Lr=!1;if("undefined"!=typeof document){Dr(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){var e=t.touches;Lr=!0;var r=e.length;jr.length=0;for(var n=0;n<r;n++){var o=e[n];jr.push(Fr(o))}})}var Ir={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0},Br=!1;if("undefined"!=typeof document){Dr(document,"mousedown mousemove",!0).start(function(t){Br=!0,Fr(t,Ir)})}var Xr,Yr=function(t){return t[0]},zr=function(t){return void 0===t&&(t={}),Lr?(e=t,r=void 0===e?{}:e,n=r.preventDefault,o=void 0===n||n,i=r.scale,a=void 0===i?1:i,u=r.rotate,s=void 0===u?0:u,ir(function(t){var e=t.update,r={touches:jr,scale:a,rotate:s},n=0,i=0,u=jr.length>1;if(u){var c=jr[0],f=jr[1];n=Xt(c,f),i=Rt(c,f)}var p=function(){if(u){var t=jr[0],o=jr[1],c=Xt(t,o),f=Rt(t,o);r.scale=a*(c/n),r.rotate=s+(f-i)}e(r)},l=Dr(document,"touchmove",{passive:!o}).start(function(t){(o||t.touches.length>1)&&t.preventDefault(),$.update(p)});return Lr&&$.update(p),{stop:function(){G.update(p),l.stop()}}})).pipe(function(t){return t.touches},Yr):function(t){var e=(void 0===t?{}:t).preventDefault,r=void 0===e||e;return ir(function(t){var e=t.update,n=function(){return e(Ir)},o=Dr(document,"mousemove").start(function(t){r&&t.preventDefault(),$.update(n)});return Br&&$.update(n),{stop:function(){G.update(n),o.stop()}}})}(t);var e,r,n,o,i,a,u,s},Ur=Object.freeze({applyOffset:Dt,clamp:jt,conditional:function(t,e){return function(r){return t(r)?e(r):r}},interpolate:function(t,e,r){var n=void 0===r?{}:r,o=n.clamp,i=void 0===o||o,a=n.ease,u=n.mixer,s=t.length;L(s===e.length,"Both input and output ranges must be the same length"),L(!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),e=[].concat(e),t.reverse(),e.reverse());var c=re(e,a,u),f=2===s?function(t,e){var r=t[0],n=t[1],o=e[0];return function(t){return o(Yt(r,n,t))}}(t,c):function(t,e){var r=t.length,n=r-1;return function(o){var i=0,a=!1;if(o<=t[0]?a=!0:o>=t[n]&&(i=n-1,a=!0),!a){for(var u=1;u<r&&!(t[u]>o||u===n);u++);i=u-1}var s=Yt(t[i],t[i+1],o);return e[i](s)}}(t,c);return i?$t(jt(t[0],t[s-1]),f):f},blendArray:Kt,blendColor:_t,pipe:$t,smooth:function(t){void 0===t&&(t=50);var e=0,r=0;return function(n){var o=tt().timestamp,i=o!==r?o-r:0,a=i?oe(e,n,i,t):e;return r=o,e=a,a}},snap:function(t){if("number"==typeof t)return function(e){return Math.round(e/t)*t};var e=0,r=t.length;return function(n){var o=Math.abs(t[0]-n);for(e=1;e<r;e++){var i=t[e],a=Math.abs(i-n);if(0===a)return i;if(a>o)return t[e-1];if(e===r-1)return i;o=a}}},generateStaticSpring:ae,nonlinearSpring:se,linearSpring:ue,wrap:pe,appendUnit:function(t){return function(e){return""+e+t}},steps:function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),function(n){var o=Yt(e,r,n);return zt(e,r,ur(t,o))}},transformMap:function(t){return function(e){var r=o({},e);for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];r[n]=i(e[n])}return r}}}),Hr=function(t){t.transition,t.flip,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.afterChildren,t.beforeChildren,t.preTransition,t.applyAtStart,t.applyAtEnd;return i(t,["transition","flip","delay","delayChildren","staggerChildren","staggerDirection","afterChildren","beforeChildren","preTransition","applyAtStart","applyAtEnd"])},Wr=function(t,e){return"function"==typeof t?t(e):t},Nr=function(t,e,r,n){return t&&void 0!==t[e]?Wr(t[e],n):r},qr=function(t,e,r,n,o,i){var a;if("function"==typeof t){var u=t(n);a=qr(u,e,r,n,o,i)}else if(t[e]||t.default){var s=t[e]||t.default;a="function"==typeof s?s(n):s}else a=t;return!1===a?i(r,n):o(r,a,n)},_r=function(t,e,r,n,o){return Object.keys(t).forEach(function(i){var a=Wr(t[i],r);e.has(i)?n(e.get(i),a):o(i,a,r)})},Zr=function(t){var e=t.state,r=t.poses,n=t.startAction,i=t.stopAction,u=t.getInstantTransition,s=t.addActionDelay,c=t.getTransitionProps,f=t.resolveTarget,p=t.transformPose,l=t.posePriority,d=t.convertTransitionDefinition,h=t.setValue,v=t.setValueNative,m=t.forceRender;return function(t,g,y){void 0===g&&(g={}),void 0===y&&(y=!0);var b=e.children,P=e.values,w=e.props,x=e.activeActions,C=e.activePoses,O=g.delay,S=void 0===O?0:O,A=b.size,k=o(o({},w),g),E=r[t],M=function(){return A&&y?function(t,e,r,n){var o=[],i=Nr(r,"delayChildren",0,n),a=Nr(r,"staggerChildren",0,n),u=Nr(r,"staggerDirection",1,n),s=(t.size-1)*a,c=1===u?function(t){return t*a}:function(t){return s-t*a};return Array.from(t).forEach(function(t,r){o.push(t.set(e,{delay:i+c(r)}))}),o}(b,t,E,k):[]},V=function(){if(!E)return[];var r=E.applyAtStart;r&&(_r(r,P,k,h,v),m&&m(k)),p&&(E=p(E,t,e));var a=E.preTransition,g=E.transition,y=E.applyAtEnd;a&&a(k);var b=Object.keys(Hr(E)).map(function(e){var r=C.has(e)?C.get(e):(C.set(e,[]),C.get(e)),a=r.indexOf(t);-1!==a&&r.splice(a,1);var p=l?l.indexOf(t):0,h=p<=0?0:function(t,e,r){for(var n=0,o=r-1;o>=0;o--){var i=t.indexOf(e[o]);if(-1!==i){n=i+1;break}}return n}(r,l,p);return r.splice(h,0,t),0===h?new Promise(function(t){var r=P.get(e),a=o(o({},k),{key:e,value:r}),p=f(r,Wr(E[e],a));x.has(e)&&i(x.get(e));var l=o(o({to:p},a),c(r,p,a)),h=qr(g,e,r,l,d,u),v=S||Wr(E.delay,a);v&&(h=s(v,h)),x.set(e,n(r,h,t))}):Promise.resolve()});return y?[Promise.all(b).then(function(){_r(y,P,k,h,v)})]:b};if(E&&A){if(Wr(E.beforeChildren,k))return Promise.all(V()).then(function(){return Promise.all(M())});if(Wr(E.afterChildren,k))return Promise.all(M()).then(function(){return Promise.all(V())})}return Promise.all(a(V(),M()))}},$r=function(t){return function(t){return t.includes("scale")}(t)?1:0},Gr=function(t){var e=Array.isArray(t)?t:[t];return e.push("init"),e},Kr=function(t,e,r,n,o,i){void 0===o&&(o=$r);var a=Gr(r).filter(Boolean).find(function(r){var n=t[r];return n&&(void 0!==n[e]||n.applyAtStart&&void 0!==n.applyAtStart[e]||n.applyAtEnd&&void 0!==n.applyAtEnd[e])});return i.set(e,[a||"init"]),a?function(t,e,r){var n=t.applyAtEnd&&void 0!==t.applyAtEnd[e]?t.applyAtEnd[e]:void 0!==t[e]?t[e]:t.applyAtStart&&void 0!==t.applyAtStart[e]?t.applyAtStart[e]:0;return Wr(n,r)}(t[a],e,n):o(e,n)},Jr=function(t,e){return function(r){var n=e.poses[r];Object.keys(Hr(n)).forEach(function(t,e){var r=e.userSetValues,n=e.createValue,o=e.convertValue,i=e.readValueFromSource,a=e.initialPose,u=e.poses,s=e.activePoses,c=e.props;return function(e){if(!t.has(e)){var f;if(r&&void 0!==r[e])f=o(r[e],e,c);else{var p=Kr(u,e,a,c,i,s);f=n(p,e,c)}t.set(e,f)}}}(t,e))}},Qr=function(t){var e=t.poses,r=t.passive,n=new Map;return Object.keys(e).forEach(Jr(n,t)),function(t){var e=t.setValueNative,r=t.initialPose,n=t.props,o=t.poses,i=new Set,a=function(t,r){if(t[r])for(var o in t[r])i.has(o)||(i.add(o),e(o,Wr(t[r][o],n),n))};Gr(r).forEach(function(t){var e=o[t];e&&(a(e,"applyAtEnd"),a(e,"applyAtStart"))})}(t),r&&Object.keys(r).forEach(function(t,e){var r=e.passive,n=e.ancestorValues,o=e.createValue,i=e.readValue,a=e.props;return function(e){var u=r[e],s=u[0],c=u[1],f=u[2],p=f&&n.length?function(t,e,r){if(!0===e)return r[0]&&r[0].values.get(t);var n=r.find(function(t){return t.label===e});return n&&n.values.get(t)}(s,f,n):!!t.has(s)&&t.get(s);if(p){var l=o(i(p),e,a,{passiveParentKey:s,passiveParent:p,passiveProps:c});t.set(e,l)}}}(n,t)),n},tn=function(t,e){return Object.keys(t).forEach(function(r){var n=t[r];t[r]=void 0!==n.transition?n:function(t,e,r){return o(o({},t),{transition:r.has(e)?r.get(e):r.get("default")})}(n,r,e)}),t},en=function(t){var e=t.getDefaultProps,r=t.defaultTransitions,n=t.bindOnChange,u=t.startAction,s=t.stopAction,c=t.readValue,f=t.readValueFromSource,p=t.resolveTarget,l=t.setValue,d=t.setValueNative,h=t.createValue,v=t.convertValue,m=t.getInstantTransition,g=t.getTransitionProps,y=t.addActionDelay,b=t.selectValueToRead,P=t.convertTransitionDefinition,w=t.transformPose,x=t.posePriority,C=t.forceRender,O=t.extendAPI;return function(t){var S=t.parentValues,A=t.ancestorValues,k=void 0===A?[]:A;S&&k.unshift({values:S});var E=new Map,M=new Map,V=new Set,T=tn(function(t){t.label,t.props,t.values,t.parentValues,t.ancestorValues,t.onChange,t.passive,t.initialPose;return i(t,["label","props","values","parentValues","ancestorValues","onChange","passive","initialPose"])}(t),r),R=t.props,D=void 0===R?{}:R;e&&(D=o(o({},e(t)),D));var F=t.passive,j=t.values,L=t.initialPose,I=void 0===L?"init":L,B=Qr({poses:T,passive:F,ancestorValues:k,readValue:c,setValueNative:d,createValue:h,convertValue:v,readValueFromSource:f,userSetValues:j,initialPose:I,activePoses:M,props:D}),X={activeActions:E,activePoses:M,children:V,props:D,values:B},Y=t.onChange;Y&&Object.keys(Y).forEach(n(B,Y));var z=Zr({state:X,poses:T,getInstantTransition:m,getTransitionProps:g,convertTransitionDefinition:P,setValue:l,setValueNative:d,startAction:u,stopAction:s,resolveTarget:p,addActionDelay:y,transformPose:w,posePriority:x,forceRender:C});return O({set:z,unset:function(t,e){var r=[];M.forEach(function(e){var n=e.indexOf(t);if(-1!==n){var o=e[0];e.splice(n,1);var i=e[0];i!==o&&-1===r.indexOf(i)&&r.push(i)}});var n,o=r.sort((n=x,function(t,e){var r=n.indexOf(t),o=n.indexOf(e);return-1===r&&-1!==o?-1:-1!==r&&-1===o?1:r-o})).map(function(t){return z(t,e,!1)});return V.forEach(function(e){return o.push(e.unset(t))}),Promise.all(o)},get:function(t){return t?b(B.get(t)):function(t,e){var r={};return t.forEach(function(t,n){return r[n]=e(t)}),r}(B,b)},has:function(t){return!!T[t]},setProps:function(t){return X.props=o(o({},X.props),t)},_addChild:function(e,r){var n=r(o(o({initialPose:I},e),{ancestorValues:a([{label:t.label,values:B}],k)}));return V.add(n),n},removeChild:function(t){return V.delete(t)},clearChildren:function(){V.forEach(function(t){return t.destroy()}),V.clear()},destroy:function(){E.forEach(s),V.forEach(function(t){return t.destroy()})}},X,t)}},rn=function(){return(rn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function nn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Xr||(Xr={}));var on=function(t,e){return"function"==typeof t?t(e):t},an=Ur.interpolate,un=function(t){return function(e){var r;return function(t){void 0===t&&(t={});var e=t.x,r=t.y,n=i(t,["x","y"]);if(void 0!==e||void 0!==r){var o=Dt(e||0),a=Dt(r||0),u={x:0,y:0};return zr(n).pipe(function(t){return u.x=o(t.x),u.y=a(t.y),u})}return zr(n)}((r={},r[t]="string"==typeof e?parseFloat(e):e,r)).pipe(function(e){return e[t]})}},sn=un("x"),cn=un("y"),fn=function(t,e,r,n){return function(o){var i=o.from,a=o.type,u=o.dimensions,s=o.dragBounds,c=t(u.measurementAsPixels(n,i,a)),f=[];if(s){var p=on(s,o);void 0!==p[e]&&f.push(function(t){return Math.max(t,u.measurementAsPixels(n,p[e],a))}),void 0!==p[r]&&f.push(function(t){return Math.min(t,u.measurementAsPixels(n,p[r],a))})}return a===y&&f.push(an([0,u.get(n)],[0,100],{clamp:!1}),function(t){return t+"%"}),f.length?c.pipe.apply(c,f):c}},pn=function(t){return ir(function(e){var r=e.update,n=e.complete;r(t),n()})},ln=function(t){var e=t.from,r=t.velocity,n=t.to;return kr({from:e,to:n,velocity:r,stiffness:500,damping:25,restDelta:.5,restSpeed:10})},dn=function(t){var e=t.from,r=t.velocity,n=t.to;return kr({from:e,to:n,velocity:r,stiffness:700,damping:0===n?100:35})},hn={x:ln,y:ln,z:ln,rotate:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scaleX:dn,scaleY:dn,scale:dn,opacity:function(t){var e=t.from,r=t.to;return Vr({from:e,to:r,ease:it})},default:Vr},vn=rn(rn({},hn),{x:fn(sn,"left","right",Xr.width),y:fn(cn,"top","bottom",Xr.height)}),mn=function(t){var e=t.from;return pn(e)},gn=new Map([["default",hn],["drag",vn],["dragEnd",rn(rn({},hn),{x:mn,y:mn})]]),yn={tween:Vr,spring:kr,decay:Ar,keyframes:function(t){var e=t.easings,r=t.ease,n=void 0===r?it:r,a=t.times,u=t.values,s=i(t,["easings","ease","times","values"]);e=Array.isArray(e)?e:function(t,e){return t.map(function(){return e||ut}).splice(0,t.length-1)}(u,e),a=a||function(t){var e=t.length;return t.map(function(t,r){return 0!==r?r/(e-1):0})}(u);var c=e.map(function(t,e){return Er({from:u[e],to:u[e+1],ease:t})});return Vr(o({},s,{ease:n})).applyMiddleware(function(t){return function(t,e,r){var n=t.length,o=n-1,i=o-1,a=e.map(function(t){return t.start(r)});return function(e){e<=t[0]&&a[0].seek(0),e>=t[o]&&a[i].seek(1);for(var r=1;r<n&&!(t[r]>e||r===o);r++);var u=Yt(t[r-1],t[r],e);a[r-1].seek(Tr(u))}}(a,c,t)})},physics:Rr},bn={linear:it,easeIn:at,easeOut:ut,easeInOut:st,circIn:ct,circOut:ft,circInOut:pt,backIn:lt,backOut:dt,backInOut:ht,anticipate:vt},Pn=[d,g,y,b,w,P,{test:function(t){return"auto"===t},parse:function(t){return t}}],wn=function(t){return Pn.find(function(t){return function(e){return e.test(t)}}(t))},xn=function(t,e){return void 0===t&&(t=0),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ir(function(e){var r,n=e.update,o=e.complete,i=0,a=function(){r=t[i].start({complete:function(){++i>=t.length?o():a()},update:n})};return a(),{stop:function(){return r&&r.stop()}}})}((r=t,ir(function(t){var e=t.complete,n=setTimeout(e,r);return{stop:function(){return clearTimeout(n)}}})),e);var r},Cn=function(t){var e=t.startEvents,r=t.endEvents,n=t.startPose,o=t.endPose,i=t.startCallback,a=t.endCallback,u=t.useDocumentToEnd,s=t.preventScroll;return function(t,c,f,p){var l=n+"Start",d=n+"End",h=n+"Move";if(s){var v=Dr(t,"touchmove",{passive:!1}).start(function(t){t.preventDefault()});c.set(h,v)}var m=Dr(t,e).start(function(e){f.unset(o),f.set(n),i&&p[i]&&p[i](e);var s=Dr(u?document.documentElement:t,r+(u?" mouseenter":"")).start(function(t){u&&"mouseenter"===t.type&&1===t.buttons||(c.get(d).stop(),f.unset(n),f.set(o),a&&p[a]&&p[a](t))});c.set(d,s)});c.set(l,m)}},On={draggable:Cn({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"drag",endPose:"dragEnd",startCallback:"onDragStart",endCallback:"onDragEnd",useDocumentToEnd:!0,preventScroll:!0}),hoverable:Cn({startEvents:"mouseenter",endEvents:"mouseleave",startPose:"hover",endPose:"hoverEnd"}),focusable:Cn({startEvents:"focus",endEvents:"blur",startPose:"focus",endPose:"blur"}),pressable:Cn({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"press",endPose:"pressEnd",startCallback:"onPressStart",endCallback:"onPressEnd",useDocumentToEnd:!0})},Sn=Object.keys(On),An=function(t){var e=t.top,r=t.right,n=t.bottom;return{x:(t.left+r)/2,y:(e+n)/2}},kn=["width","height","top","left","bottom","right"],En=new Set(kn),Mn=function(t){return En.has(t)},Vn=function(t,e,r){var n=t.values,o=t.props;if(n.has(e)){var i=n.get(e).raw;i.update(r),i.update(r)}else n.set(e,{raw:pr(r,function(t){return o.elementStyler.set(e,t)})})},Tn=function(t,e){var r=t.props,n=r.dimensions,o=r.element,i=r.elementStyler;if(!n.has())return{};var a=n.get(),u=function(t){var e=t.style.transform;t.style.transform="";var r=t.getBoundingClientRect();return t.style.transform=e,r}(o),s=a.left===u.left?0:a.right===u.right?"100%":"50%",c=a.top===u.top?0:a.bottom===u.bottom?"100%":"50%";i.set({originX:s,originY:c}),a.width!==u.width&&(Vn(t,"scaleX",a.width/u.width),e.scaleX=1),a.height!==u.height&&(Vn(t,"scaleY",a.height/u.height),e.scaleY=1);var f=An(a),p=An(u);return"50%"===s&&(Vn(t,"x",f.x-p.x),e.x=0),"50%"===c&&(Vn(t,"y",f.y-p.y),e.y=0),i.render(),e},Rn=function(t,e){return r=e,Object.keys(r).some(Mn)?function(t,e){var r=t.props,n=r.dimensions,o=r.elementStyler;n.measure();e.width,e.height,e.top,e.left,e.bottom,e.right,e.position;var i=nn(e,["width","height","top","left","bottom","right","position"]),a=kn.concat("position").reduce(function(r,n){return void 0!==e[n]&&(r[n]=on(e[n],t.props)),r},{});return o.set(a).render(),Tn(t,i)}(t,e):Tn(t,e);var r},Dn=function(t,e){return parseFloat(t.split(", ")[e])},Fn=function(t,e){return function(r,n,o){var i=o.transform;if(!i||"none"===i)return 0;var a=i.match(/^matrix3d\((.+)\)$/);return a?Dn(a[1],e):Dn(i.match(/^matrix\((.+)\)$/)[1],t)}},jn={width:function(t,e){return e.width},height:function(t,e){return e.height},top:function(t,e,r){var n=r.top;return parseFloat(n)},left:function(t,e,r){var n=r.left;return parseFloat(n)},bottom:function(t,e,r){var n=e.height,o=r.top;return parseFloat(o)+n},right:function(t,e,r){var n=e.width,o=r.left;return parseFloat(o)+n},x:Fn(4,13),y:Fn(5,14)},Ln=function(t){return void 0!==jn[t]},In=function(t){return function(e){return e.elementStyler.get(t)}},Bn=function(t,e){var r,n,o,i=e.onDragStart,a=e.onDragEnd,u=e.onPressStart,s=e.onPressEnd,c=e.draggable,f=e.hoverable,p=e.focusable,l=e.pressable,d=e.dragBounds,h=nn(e,["onDragStart","onDragEnd","onPressStart","onPressEnd","draggable","hoverable","focusable","pressable","dragBounds"]),v=rn(rn({flip:{}},h),{props:rn(rn({},h.props),{onDragStart:i,onDragEnd:a,onPressStart:u,onPressEnd:s,dragBounds:d,draggable:c,hoverable:f,focusable:p,pressable:l,element:t,elementStyler:(r=t,n={preparseOutput:!1},o="string"==typeof r?document.querySelector(r):r,tr(o,n)),dimensions:function(t){var e=!1,r={width:0,height:0,top:0,left:0,bottom:0,right:0};return{get:function(t){return t?r[t]:r},measure:function(){return r=t.getBoundingClientRect(),e=!0,r},measurementAsPixels:function(t,e,n){return n===y?("string"==typeof e?parseFloat(e):e)/100*r[t]:e},has:function(){return e}}}(t)})});if(c){var m=function(t){var e={preTransition:function(t){return t.dimensions.measure()}},r={};return!0!==t&&"x"!==t||(e.x=r.x=In("x")),!0!==t&&"y"!==t||(e.y=r.y=In("y")),{drag:e,dragEnd:r}}(c),g=m.drag,b=m.dragEnd;v.drag=rn(rn({},g),v.drag),v.dragEnd=rn(rn({},b),v.dragEnd)}return v},Xn=function(t){var e=t.transformPose,r=t.addListenerToValue,n=t.extendAPI,o=t.readValueFromSource,i=t.posePriority,a=t.setValueNative;return en({bindOnChange:function(t,e){return function(r){t.has(r)&&t.get(r).raw.subscribe(e[r])}},readValue:function(t){return t.raw.get()},setValue:function(t,e){return t.raw.update(e)},createValue:function(t,e,n,o){var i=n.elementStyler,a=void 0===o?{}:o,u=a.passiveParent,s=a.passiveProps,c=u?function(t,e,r){var n=pr(r(t));return e.raw.subscribe(function(t){return n.update(r(t))}),{raw:n}}(t,u,s):function(t){var e=wn(t);return{raw:pr(t),type:e}}(t);return c.raw.subscribe(r(e,i)),c},convertValue:function(t,e,n){var o=n.elementStyler;return t.subscribe(r(e,o)),{raw:t,type:wn(t.get())}},getTransitionProps:function(t,e){var r=t.raw,n=t.type;return{from:r.get(),velocity:r.getVelocity(),to:e,type:n}},resolveTarget:function(t,e){return e},selectValueToRead:function(t){return t.raw},startAction:function(t,e,r){var n=t.raw,o={update:function(t){return n.update(t)},complete:r};return e.start(o)},stopAction:function(t){return t.stop()},getInstantTransition:function(t,e){var r=e.to;return pn(r)},convertTransitionDefinition:function(t,e,r){if(function(t){return void 0!==t.start}(e))return e;var n=e.delay,o=e.min,i=e.max,a=e.round,u=function(t,e,r){var n,o=r.from,i=r.to,a=r.velocity,u=e.type,s=void 0===u?"tween":u,c=e.ease,f=nn(e,["type","ease"]);yn[s],"tween"===s&&"function"!=typeof c&&("string"==typeof c?n=bn[c]:Array.isArray(c)&&"number"==typeof c[0]&&(c.length,n=Et(c[0],c[1],c[2],c[3]))),n=n||c;var p="keyframes"!==s?{from:o,to:i,velocity:a,ease:n}:{ease:n};return yn[s](rn(rn({},p),f))}(0,nn(e,["delay","min","max","round"]),r),s=[];return n&&(u=xn(n,u)),void 0!==o&&s.push(function(t){return Math.max(t,o)}),void 0!==i&&s.push(function(t){return Math.min(t,i)}),a&&s.push(Math.round),s.length?u.pipe.apply(u,s):u},setValueNative:a,addActionDelay:xn,defaultTransitions:gn,transformPose:e,readValueFromSource:o,posePriority:i,extendAPI:n})}({posePriority:["drag","press","focus","hover"],transformPose:function(t,e,r){var n,o=t.flip,i=nn(t,["flip"]);return function(t,e,r){return r.props.element instanceof HTMLElement&&(!0===t||"flip"===e)}(o,e,r)?Rn(r,i):(n=i,Object.keys(n).some(Ln)?function(t,e){var r=t.values,n=t.props,o=n.element,i=n.elementStyler,a=Object.keys(e).filter(Ln),u=[],s=getComputedStyle(o),c=!1;if(a.forEach(function(o){var i=r.get(o),a=wn(i.raw.get()),s=on(e[o],n);a!==wn(s)&&(u.push(o),c||(c=!0,e.applyAtEnd=e.applyAtEnd?rn({},e.applyAtEnd):{}),e.applyAtEnd[o]=e.applyAtEnd[o]||e[o],Vn(t,o,s))}),!u.length)return e;var f=o.getBoundingClientRect(),p={top:s.top,left:s.left,bottom:s.bottom,right:s.right,transform:s.transform};i.render();var l=o.getBoundingClientRect();return u.forEach(function(r){Vn(t,r,jn[r](o,f,p)),e[r]=jn[r](o,l,s)}),i.render(),e}(r,i):i)},forceRender:function(t){t.elementStyler.render()},addListenerToValue:funct