{"version":3,"sources":["node_modules\\animated\\lib\\SpringAnimation.js"],"names":["_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_classCallCheck","instance","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","create","constructor","value","setPrototypeOf","__proto__","Animation","require","AnimatedValue","RequestAnimationFrame","CancelAnimationFrame","invariant","SpringConfig","withDefault","defaultValue","undefined","SpringAnimation","_Animation","config","_this","getPrototypeOf","_overshootClamping","overshootClamping","_restDisplacementThreshold","restDisplacementThreshold","_restSpeedThreshold","restSpeedThreshold","_initialVelocity","velocity","_lastVelocity","_toValue","toValue","__isInteraction","isInteraction","springConfig","bounciness","speed","tension","friction","fromBouncinessAndSpeed","fromOrigamiTensionAndFriction","_tension","_friction","start","fromValue","onUpdate","onEnd","previousAnimation","__active","_startPosition","_lastPosition","_onUpdate","__onEnd","_lastTime","Date","now","internalState","getInternalState","lastPosition","lastVelocity","lastTime","position","tempPosition","tempVelocity","MAX_STEPS","TIMESTEP_MSEC","numSteps","Math","floor","step","aVelocity","aAcceleration","bVelocity","bAcceleration","cVelocity","cAcceleration","dVelocity","dAcceleration","dxdt","dvdt","isOvershooting","isVelocity","abs","isDisplacement","__debouncedOnEnd","finished","_animationFrame","current","bind","stop","module","exports"],"mappings":";;;;;;;;;;AAUA,aAAa,GAAIA,cAAa,UAAU,CAAC,QAASC,iBAAT,CAA0BC,MAA1B,CAAiCC,KAAjC,CAAuC,CAAC,IAAI,GAAIC,GAAE,CAAV,CAAYA,EAAED,MAAME,MAApB,CAA2BD,GAA3B,CAA+B,CAAC,GAAIE,YAAWH,MAAMC,CAAN,CAAf,CAAwBE,WAAWC,UAAX,CAAsBD,WAAWC,UAAX,EAAuB,KAA7C,CAAmDD,WAAWE,YAAX,CAAwB,IAAxB,CAA6B,GAAG,SAAUF,WAAb,CAAwBA,WAAWG,QAAX,CAAoB,IAApB,CAAyBC,OAAOC,cAAP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D,eAAenB,SAAS,KAAK/B,QAA7B;AACC,CAFD,IAEK;AACLkD,eAAenB,SAAS,KAAK/B,QAA7B;AACC;AACA;AACD,GAAImD,YAAWd,KAAKe,GAAL,CAAStD,QAAT,GAAoB,KAAKH,mBAAxC;AACA,GAAI0D,gBAAe,IAAnB;AACA,GAAG,KAAK1C,QAAL,GAAgB,CAAnB,CAAqB;AACrB0C,eAAehB,KAAKe,GAAL,CAAS,KAAKpD,QAAL,CAAc+B,QAAvB,GAAkC,KAAKtC,0BAAtD;AACC;;AAED,GAAGyD,gBAAgBC,YAAYE,cAA/B,CAA8C;AAC9C,GAAG,KAAK1C,QAAL,GAAgB,CAAnB,CAAqB;;AAErB,KAAKU,SAAL,CAAe,KAAKrB,QAApB;AACC;;AAED,KAAKsD,gBAAL,CAAsB,CAACC,SAAS,IAAV,CAAtB;AACA;AACC;AACD,KAAKC,eAAL,CAAqB7E,sBAAsB8E,OAAtB,CAA8B,KAAK1C,QAAL,CAAc2C,IAAd,CAAmB,IAAnB,CAA9B,CAArB;AACC,CA5FE,CAnC2B,CA+H3B,CAACtG,IAAI,MAAL,CAAYiB,MAAM,QAASsF,KAAT;;AAErB;AACA,KAAKzC,QAAL,CAAc,KAAd;AACAtC,qBAAqB6E,OAArB,CAA6B,KAAKD,eAAlC;AACA,KAAKF,gBAAL,CAAsB,CAACC,SAAS,KAAV,CAAtB;AACC,CANE,CA/H2B,CAA7B,EAqII,MAAOrE,gBAAP,CAAwB,CApLb,CAoLcV,SApLd,CAFf;;;AAyLDoF,OAAOC,OAAP,CAAe3E,eAAf","file":"SpringAnimation.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["\n\n\n\n\n\n\n\n\n\n'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if(\"value\"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError(\"Cannot call a class as a function\");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return call&&(typeof call===\"object\"||typeof call===\"function\")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!==\"function\"&&superClass!==null){throw new TypeError(\"Super expression must either be null or a function, not \"+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}\n\nvar Animation=require('./Animation');\nvar AnimatedValue=require('./AnimatedValue');\nvar RequestAnimationFrame=require('./injectable/RequestAnimationFrame');\nvar CancelAnimationFrame=require('./injectable/CancelAnimationFrame');\nvar invariant=require('invariant');\nvar SpringConfig=require('./SpringConfig');\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction withDefault(value,defaultValue){\nif(value===undefined||value===null){\nreturn defaultValue;\n}\nreturn value;\n}var\n\nSpringAnimation=function(_Animation){_inherits(SpringAnimation,_Animation);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction SpringAnimation(\nconfig)\n{_classCallCheck(this,SpringAnimation);var _this=_possibleConstructorReturn(this,(SpringAnimation.__proto__||Object.getPrototypeOf(SpringAnimation)).call(this));\n\n\n_this._overshootClamping=withDefault(config.overshootClamping,false);\n_this._restDisplacementThreshold=withDefault(config.restDisplacementThreshold,0.001);\n_this._restSpeedThreshold=withDefault(config.restSpeedThreshold,0.001);\n_this._initialVelocity=config.velocity;\n_this._lastVelocity=withDefault(config.velocity,0);\n_this._toValue=config.toValue;\n_this.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;\n\nvar springConfig;\nif(config.bounciness!==undefined||config.speed!==undefined){\ninvariant(\nconfig.tension===undefined&&config.friction===undefined,\n'You can only define bounciness/speed or tension/friction but not both');\n\nspringConfig=SpringConfig.fromBouncinessAndSpeed(\nwithDefault(config.bounciness,8),\nwithDefault(config.speed,12));\n\n}else{\nspringConfig=SpringConfig.fromOrigamiTensionAndFriction(\nwithDefault(config.tension,40),\nwithDefault(config.friction,7));\n\n}\n_this._tension=springConfig.tension;\n_this._friction=springConfig.friction;return _this;\n}_createClass(SpringAnimation,[{key:'start',value:function start(\n\n\nfromValue,\nonUpdate,\nonEnd,\npreviousAnimation)\n{\nthis.__active=true;\nthis._startPosition=fromValue;\nthis._lastPosition=this._startPosition;\n\nthis._onUpdate=onUpdate;\nthis.__onEnd=onEnd;\nthis._lastTime=Date.now();\n\nif(previousAnimation instanceof SpringAnimation){\nvar internalState=previousAnimation.getInternalState();\nthis._lastPosition=internalState.lastPosition;\nthis._lastVelocity=internalState.lastVelocity;\nthis._lastTime=internalState.lastTime;\n}\nif(this._initialVelocity!==undefined&&\nthis._initialVelocity!==null){\nthis._lastVelocity=this._initialVelocity;\n}\nthis.onUpdate();\n}},{key:'getInternalState',value:function getInternalState()\n\n{\nreturn{\nlastPosition:this._lastPosition,\nlastVelocity:this._lastVelocity,\nlastTime:this._lastTime};\n\n}},{key:'onUpdate',value:function onUpdate()\n\n{\nvar position=this._lastPosition;\nvar velocity=this._lastVelocity;\n\nvar tempPosition=this._lastPosition;\nvar tempVelocity=this._lastVelocity;\n\n\n\n\n\nvar MAX_STEPS=64;\nvar now=Date.now();\nif(now>this._lastTime+MAX_STEPS){\nnow=this._lastTime+MAX_STEPS;\n}\n\n\n\n\nvar TIMESTEP_MSEC=1;\nvar numSteps=Math.floor((now-this._lastTime)/TIMESTEP_MSEC);\n\nfor(var i=0;i<numSteps;++i){\n\nvar step=TIMESTEP_MSEC/1000;\n\n\n\nvar aVelocity=velocity;\nvar aAcceleration=this._tension*(this._toValue-tempPosition)-this._friction*tempVelocity;\nvar tempPosition=position+aVelocity*step/2;\nvar tempVelocity=velocity+aAcceleration*step/2;\n\nvar bVelocity=tempVelocity;\nvar bAcceleration=this._tension*(this._toValue-tempPosition)-this._friction*tempVelocity;\ntempPosition=position+bVelocity*step/2;\ntempVelocity=velocity+bAcceleration*step/2;\n\nvar cVelocity=tempVelocity;\nvar cAcceleration=this._tension*(this._toValue-tempPosition)-this._friction*tempVelocity;\ntempPosition=position+cVelocity*step/2;\ntempVelocity=velocity+cAcceleration*step/2;\n\nvar dVelocity=tempVelocity;\nvar dAcceleration=this._tension*(this._toValue-tempPosition)-this._friction*tempVelocity;\ntempPosition=position+cVelocity*step/2;\ntempVelocity=velocity+cAcceleration*step/2;\n\nvar dxdt=(aVelocity+2*(bVelocity+cVelocity)+dVelocity)/6;\nvar dvdt=(aAcceleration+2*(bAcceleration+cAcceleration)+dAcceleration)/6;\n\nposition+=dxdt*step;\nvelocity+=dvdt*step;\n}\n\nthis._lastTime=now;\nthis._lastPosition=position;\nthis._lastVelocity=velocity;\n\nthis._onUpdate(position);\nif(!this.__active){\nreturn;\n}\n\n\nvar isOvershooting=false;\nif(this._overshootClamping&&this._tension!==0){\nif(this._startPosition<this._toValue){\nisOvershooting=position>this._toValue;\n}else{\nisOvershooting=position<this._toValue;\n}\n}\nvar isVelocity=Math.abs(velocity)<=this._restSpeedThreshold;\nvar isDisplacement=true;\nif(this._tension!==0){\nisDisplacement=Math.abs(this._toValue-position)<=this._restDisplacementThreshold;\n}\n\nif(isOvershooting||isVelocity&&isDisplacement){\nif(this._tension!==0){\n\nthis._onUpdate(this._toValue);\n}\n\nthis.__debouncedOnEnd({finished:true});\nreturn;\n}\nthis._animationFrame=RequestAnimationFrame.current(this.onUpdate.bind(this));\n}},{key:'stop',value:function stop()\n\n{\nthis.__active=false;\nCancelAnimationFrame.current(this._animationFrame);\nthis.__debouncedOnEnd({finished:false});\n}}]);return SpringAnimation;}(Animation);\n\n\nmodule.exports=SpringAnimation;"]}