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sBAAuB,EACvB,SAAU,EACV,OAAQ,EACR,aAAc,EACd,aAAc,EACd,KAAM,EAAS,CAAC,EAAG,EAAM,IAK1B","file":"/npm/rebound@0.1.0/dist/rebound.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rebound@0.1.0/dist/rebound.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.rebound = factory());\n}(this, (function () { 'use strict';\n\nvar _onFrame = void 0;\nif (typeof window !== 'undefined') {\n  _onFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;\n}\n\nif (!_onFrame && typeof process !== 'undefined' && process.title === 'node') {\n  _onFrame = setImmediate;\n}\n\n_onFrame = _onFrame || function (callback) {\n  window.setTimeout(callback, 1000 / 60);\n};\n\nvar _onFrame$1 = _onFrame;\n\n/* eslint-disable flowtype/no-weak-types */\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\n// Bind a function to a context object.\nfunction bind(func, context) {\n  for (var _len = arguments.length, outerArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n    outerArgs[_key - 2] = arguments[_key];\n  }\n\n  return function () {\n    for (var _len2 = arguments.length, innerArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      innerArgs[_key2] = arguments[_key2];\n    }\n\n    func.apply(context, concat.call(outerArgs, slice.call(innerArgs)));\n  };\n}\n\n// Add all the properties in the source to the target.\nfunction extend(target, source) {\n  for (var key in source) {\n    if (source.hasOwnProperty(key)) {\n      target[key] = source[key];\n    }\n  }\n}\n\n// Cross browser/node timer functions.\nfunction onFrame(func) {\n  return _onFrame$1(func);\n}\n\n// Lop off the first occurence of the reference in the Array.\nfunction removeFirst(array, item) {\n  var idx = array.indexOf(item);\n  idx !== -1 && array.splice(idx, 1);\n}\n\nvar colorCache = {};\n/**\n * Converts a hex-formatted color string to its rgb-formatted equivalent. Handy\n * when performing color tweening animations\n * @public\n * @param colorString A hex-formatted color string\n * @return An rgb-formatted color string\n */\nfunction hexToRGB(colorString) {\n  if (colorCache[colorString]) {\n    return colorCache[colorString];\n  }\n  var normalizedColor = colorString.replace('#', '');\n  if (normalizedColor.length === 3) {\n    normalizedColor = normalizedColor[0] + normalizedColor[0] + normalizedColor[1] + normalizedColor[1] + normalizedColor[2] + normalizedColor[2];\n  }\n  var parts = normalizedColor.match(/.{2}/g);\n  if (!parts || parts.length < 3) {\n    throw new Error('Expected a color string of format #rrggbb');\n  }\n\n  var ret = {\n    r: parseInt(parts[0], 16),\n    g: parseInt(parts[1], 16),\n    b: parseInt(parts[2], 16)\n  };\n\n  colorCache[colorString] = ret;\n  return ret;\n}\n\n/**\n * Converts a rgb-formatted color string to its hex-formatted equivalent. Handy\n * when performing color tweening animations\n * @public\n * @param colorString An rgb-formatted color string\n * @return A hex-formatted color string\n */\nfunction rgbToHex(rNum, gNum, bNum) {\n  var r = rNum.toString(16);\n  var g = gNum.toString(16);\n  var b = bNum.toString(16);\n  r = r.length < 2 ? '0' + r : r;\n  g = g.length < 2 ? '0' + g : g;\n  b = b.length < 2 ? '0' + b : b;\n  return '#' + r + g + b;\n}\n\nvar util = Object.freeze({\n\tbind: bind,\n\textend: extend,\n\tonFrame: onFrame,\n\tremoveFirst: removeFirst,\n\thexToRGB: hexToRGB,\n\trgbToHex: rgbToHex\n});\n\n/**\n * This helper function does a linear interpolation of a value from\n * one range to another. This can be very useful for converting the\n * motion of a Spring to a range of UI property values. For example a\n * spring moving from position 0 to 1 could be interpolated to move a\n * view from pixel 300 to 350 and scale it from 0.5 to 1. The current\n * position of the `Spring` just needs to be run through this method\n * taking its input range in the _from_ parameters with the property\n * animation range in the _to_ parameters.\n * @public\n */\nfunction mapValueInRange(value, fromLow, fromHigh, toLow, toHigh) {\n  var fromRangeSize = fromHigh - fromLow;\n  var toRangeSize = toHigh - toLow;\n  var valueScale = (value - fromLow) / fromRangeSize;\n  return toLow + valueScale * toRangeSize;\n}\n\n/**\n * Interpolate two hex colors in a 0 - 1 range or optionally provide a\n * custom range with fromLow,fromHight. The output will be in hex by default\n * unless asRGB is true in which case it will be returned as an rgb string.\n *\n * @public\n * @param asRGB Whether to return an rgb-style string\n * @return A string in hex color format unless asRGB is true, in which case a string in rgb format\n */\nfunction interpolateColor(val, startColorStr, endColorStr) {\n  var fromLow = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n  var fromHigh = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;\n  var asRGB = arguments[5];\n\n  var startColor = hexToRGB(startColorStr);\n  var endColor = hexToRGB(endColorStr);\n  var r = Math.floor(mapValueInRange(val, fromLow, fromHigh, startColor.r, endColor.r));\n  var g = Math.floor(mapValueInRange(val, fromLow, fromHigh, startColor.g, endColor.g));\n  var b = Math.floor(mapValueInRange(val, fromLow, fromHigh, startColor.b, endColor.b));\n  if (asRGB) {\n    return 'rgb(' + r + ',' + g + ',' + b + ')';\n  } else {\n    return rgbToHex(r, g, b);\n  }\n}\n\nfunction degreesToRadians(deg) {\n  return deg * Math.PI / 180;\n}\n\nfunction radiansToDegrees(rad) {\n  return rad * 180 / Math.PI;\n}\n\nvar MathUtil = Object.freeze({\n\tmapValueInRange: mapValueInRange,\n\tinterpolateColor: interpolateColor,\n\tdegreesToRadians: degreesToRadians,\n\tradiansToDegrees: radiansToDegrees\n});\n\n// Math for converting from\n// [Origami](http://facebook.github.io/origami/) to\n// [Rebound](http://facebook.github.io/rebound).\n// You mostly don't need to worry about this, just use\n// SpringConfig.fromOrigamiTensionAndFriction(v, v);\n\nfunction tensionFromOrigamiValue(oValue) {\n  return (oValue - 30.0) * 3.62 + 194.0;\n}\n\nfunction origamiValueFromTension(tension) {\n  return (tension - 194.0) / 3.62 + 30.0;\n}\n\nfunction frictionFromOrigamiValue(oValue) {\n  return (oValue - 8.0) * 3.0 + 25.0;\n}\n\nfunction origamiFromFriction(friction) {\n  return (friction - 25.0) / 3.0 + 8.0;\n}\n\nvar OrigamiValueConverter = Object.freeze({\n\ttensionFromOrigamiValue: tensionFromOrigamiValue,\n\torigamiValueFromTension: origamiValueFromTension,\n\tfrictionFromOrigamiValue: frictionFromOrigamiValue,\n\torigamiFromFriction: origamiFromFriction\n});\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n\n    for (var key in source) {\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n\n  return target;\n};\n\n/**\n * Plays each frame of the SpringSystem on animation\n * timing loop. This is the default type of looper for a new spring system\n * as it is the most common when developing UI.\n * @public\n */\n/**\n *  Copyright (c) 2013, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nvar AnimationLooper = function () {\n  function AnimationLooper() {\n    classCallCheck(this, AnimationLooper);\n    this.springSystem = null;\n  }\n\n  AnimationLooper.prototype.run = function run() {\n    var springSystem = getSpringSystem.call(this);\n\n    onFrame(function () {\n      springSystem.loop(Date.now());\n    });\n  };\n\n  return AnimationLooper;\n}();\n\n/**\n * Resolves the SpringSystem to a resting state in a\n * tight and blocking loop. This is useful for synchronously generating\n * pre-recorded animations that can then be played on a timing loop later.\n * Sometimes this lead to better performance to pre-record a single spring\n * curve and use it to drive many animations; however, it can make dynamic\n * response to user input a bit trickier to implement.\n * @public\n */\nvar SimulationLooper = function () {\n  function SimulationLooper(timestep) {\n    classCallCheck(this, SimulationLooper);\n    this.springSystem = null;\n    this.time = 0;\n    this.running = false;\n\n    this.timestep = timestep || 16.667;\n  }\n\n  SimulationLooper.prototype.run = function run() {\n    var springSystem = getSpringSystem.call(this);\n\n    if (this.running) {\n      return;\n    }\n    this.running = true;\n    while (!springSystem.getIsIdle()) {\n      springSystem.loop(this.time += this.timestep);\n    }\n    this.running = false;\n  };\n\n  return SimulationLooper;\n}();\n\n/**\n * Resolves the SpringSystem one step at a\n * time controlled by an outside loop. This is useful for testing and\n * verifying the behavior of a SpringSystem or if you want to control your own\n * timing loop for some reason e.g. slowing down or speeding up the\n * simulation.\n * @public\n */\nvar SteppingSimulationLooper = function () {\n  function SteppingSimulationLooper() {\n    classCallCheck(this, SteppingSimulationLooper);\n    this.springSystem = null;\n    this.time = 0;\n    this.running = false;\n  }\n\n  SteppingSimulationLooper.prototype.run = function run() {}\n  // this.run is NOOP'd here to allow control from the outside using\n  // this.step.\n\n\n  // Perform one step toward resolving the SpringSystem.\n  ;\n\n  SteppingSimulationLooper.prototype.step = function step(timestep) {\n    var springSystem = getSpringSystem.call(this);\n    springSystem.loop(this.time += timestep);\n  };\n\n  return SteppingSimulationLooper;\n}();\n\nfunction getSpringSystem() {\n  if (this.springSystem == null) {\n    throw new Error('cannot run looper without a springSystem');\n  }\n  return this.springSystem;\n}\n\n\n\nvar Loopers = Object.freeze({\n\tAnimationLooper: AnimationLooper,\n\tSimulationLooper: SimulationLooper,\n\tSteppingSimulationLooper: SteppingSimulationLooper\n});\n\n/**\n * Provides math for converting from Origami PopAnimation\n * config values to regular Origami tension and friction values. If you are\n * trying to replicate prototypes made with PopAnimation patches in Origami,\n * then you should create your springs with\n * SpringSystem.createSpringWithBouncinessAndSpeed, which uses this Math\n * internally to create a spring to match the provided PopAnimation\n * configuration from Origami.\n */\nvar BouncyConversion = function () {\n  function BouncyConversion(bounciness, speed) {\n    classCallCheck(this, BouncyConversion);\n\n    this.bounciness = bounciness;\n    this.speed = speed;\n\n    var b = this.normalize(bounciness / 1.7, 0, 20.0);\n    b = this.projectNormal(b, 0.0, 0.8);\n    var s = this.normalize(speed / 1.7, 0, 20.0);\n\n    this.bouncyTension = this.projectNormal(s, 0.5, 200);\n    this.bouncyFriction = this.quadraticOutInterpolation(b, this.b3Nobounce(this.bouncyTension), 0.01);\n  }\n\n  BouncyConversion.prototype.normalize = function normalize(value, startValue, endValue) {\n    return (value - startValue) / (endValue - startValue);\n  };\n\n  BouncyConversion.prototype.projectNormal = function projectNormal(n, start, end) {\n    return start + n * (end - start);\n  };\n\n  BouncyConversion.prototype.linearInterpolation = function linearInterpolation(t, start, end) {\n    return t * end + (1.0 - t) * start;\n  };\n\n  BouncyConversion.prototype.quadraticOutInterpolation = function quadraticOutInterpolation(t, start, end) {\n    return this.linearInterpolation(2 * t - t * t, start, end);\n  };\n\n  BouncyConversion.prototype.b3Friction1 = function b3Friction1(x) {\n    return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;\n  };\n\n  BouncyConversion.prototype.b3Friction2 = function b3Friction2(x) {\n    return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2;\n  };\n\n  BouncyConversion.prototype.b3Friction3 = function b3Friction3(x) {\n    return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84;\n  };\n\n  BouncyConversion.prototype.b3Nobounce = function b3Nobounce(tension) {\n    var friction = 0;\n    if (tension <= 18) {\n      friction = this.b3Friction1(tension);\n    } else if (tension > 18 && tension <= 44) {\n      friction = this.b3Friction2(tension);\n    } else {\n      friction = this.b3Friction3(tension);\n    }\n    return friction;\n  };\n\n  return BouncyConversion;\n}();\n\n/**\n * Maintains a set of tension and friction constants\n * for a Spring. You can use fromOrigamiTensionAndFriction to convert\n * values from the [Origami](http://facebook.github.io/origami/)\n * design tool directly to Rebound spring constants.\n * @public\n */\n\nvar SpringConfig = function () {\n\n  /**\n   * Convert an origami Spring tension and friction to Rebound spring\n   * constants. If you are prototyping a design with Origami, this\n   * makes it easy to make your springs behave exactly the same in\n   * Rebound.\n   * @public\n   */\n  SpringConfig.fromOrigamiTensionAndFriction = function fromOrigamiTensionAndFriction(tension, friction) {\n    return new SpringConfig(tensionFromOrigamiValue(tension), frictionFromOrigamiValue(friction));\n  };\n\n  /**\n   * Convert an origami PopAnimation Spring bounciness and speed to Rebound\n   * spring constants. If you are using PopAnimation patches in Origami, this\n   * utility will provide springs that match your prototype.\n   * @public\n   */\n\n\n  SpringConfig.fromBouncinessAndSpeed = function fromBouncinessAndSpeed(bounciness, speed) {\n    var bouncyConversion = new BouncyConversion(bounciness, speed);\n    return SpringConfig.fromOrigamiTensionAndFriction(bouncyConversion.bouncyTension, bouncyConversion.bouncyFriction);\n  };\n\n  /**\n   * Create a SpringConfig with no tension or a coasting spring with some\n   * amount of Friction so that it does not coast infininitely.\n   * @public\n   */\n\n\n  SpringConfig.coastingConfigWithOrigamiFriction = function coastingConfigWithOrigamiFriction(friction) {\n    return new SpringConfig(0, frictionFromOrigamiValue(friction));\n  };\n\n  function SpringConfig(tension, friction) {\n    classCallCheck(this, SpringConfig);\n\n    this.tension = tension;\n    this.friction = friction;\n  }\n\n  return SpringConfig;\n}();\n\nSpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG = SpringConfig.fromOrigamiTensionAndFriction(40, 7);\n\n/**\n * Consists of a position and velocity. A Spring uses\n * this internally to keep track of its current and prior position and\n * velocity values.\n */\nvar PhysicsState = function PhysicsState() {\n  classCallCheck(this, PhysicsState);\n  this.position = 0;\n  this.velocity = 0;\n};\n\n/**\n * Provides a model of a classical spring acting to\n * resolve a body to equilibrium. Springs have configurable\n * tension which is a force multipler on the displacement of the\n * spring from its rest point or `endValue` as defined by [Hooke's\n * law](http://en.wikipedia.org/wiki/Hooke's_law). Springs also have\n * configurable friction, which ensures that they do not oscillate\n * infinitely. When a Spring is displaced by updating it's resting\n * or `currentValue`, the SpringSystems that contain that Spring\n * will automatically start looping to solve for equilibrium. As each\n * timestep passes, `SpringListener` objects attached to the Spring\n * will be notified of the updates providing a way to drive an\n * animation off of the spring's resolution curve.\n * @public\n */\n\nvar Spring = function () {\n  function Spring(springSystem) {\n    classCallCheck(this, Spring);\n    this.listeners = [];\n    this._startValue = 0;\n    this._currentState = new PhysicsState();\n    this._displacementFromRestThreshold = 0.001;\n    this._endValue = 0;\n    this._overshootClampingEnabled = false;\n    this._previousState = new PhysicsState();\n    this._restSpeedThreshold = 0.001;\n    this._tempState = new PhysicsState();\n    this._timeAccumulator = 0;\n    this._wasAtRest = true;\n\n    this._id = 's' + Spring._ID++;\n    this._springSystem = springSystem;\n  }\n\n  /**\n   * Remove a Spring from simulation and clear its listeners.\n   * @public\n   */\n\n\n  Spring.prototype.destroy = function destroy() {\n    this.listeners = [];\n    this._springSystem.deregisterSpring(this);\n  };\n\n  /**\n   * Get the id of the spring, which can be used to retrieve it from\n   * the SpringSystems it participates in later.\n   * @public\n   */\n\n\n  Spring.prototype.getId = function getId() {\n    return this._id;\n  };\n\n  /**\n   * Set the configuration values for this Spring. A SpringConfig\n   * contains the tension and friction values used to solve for the\n   * equilibrium of the Spring in the physics loop.\n   * @public\n   */\n\n\n  Spring.prototype.setSpringConfig = function setSpringConfig(springConfig) {\n    this._springConfig = springConfig;\n    return this;\n  };\n\n  /**\n   * Retrieve the SpringConfig used by this Spring.\n   * @public\n   */\n\n\n  Spring.prototype.getSpringConfig = function getSpringConfig() {\n    return this._springConfig;\n  };\n\n  /**\n   * Set the current position of this Spring. Listeners will be updated\n   * with this value immediately. If the rest or `endValue` is not\n   * updated to match this value, then the spring will be dispalced and\n   * the SpringSystem will start to loop to restore the spring to the\n   * `endValue`.\n   *\n   * A common pattern is to move a Spring around without animation by\n   * calling.\n   *\n   * ```\n   * spring.setCurrentValue(n).setAtRest();\n   * ```\n   *\n   * This moves the Spring to a new position `n`, sets the endValue\n   * to `n`, and removes any velocity from the `Spring`. By doing\n   * this you can allow the `SpringListener` to manage the position\n   * of UI elements attached to the spring even when moving without\n   * animation. For example, when dragging an element you can\n   * update the position of an attached view through a spring\n   * by calling `spring.setCurrentValue(x)`. When\n   * the gesture ends you can update the Springs\n   * velocity and endValue\n   * `spring.setVelocity(gestureEndVelocity).setEndValue(flingTarget)`\n   * to cause it to naturally animate the UI element to the resting\n   * position taking into account existing velocity. The codepaths for\n   * synchronous movement and spring driven animation can\n   * be unified using this technique.\n   * @public\n   */\n\n\n  Spring.prototype.setCurrentValue = function setCurrentValue(currentValue, skipSetAtRest) {\n    this._startValue = currentValue;\n    this._currentState.position = currentValue;\n    if (!skipSetAtRest) {\n      this.setAtRest();\n    }\n    this.notifyPositionUpdated(false, false);\n    return this;\n  };\n\n  /**\n   * Get the position that the most recent animation started at. This\n   * can be useful for determining the number off oscillations that\n   * have occurred.\n   * @public\n   */\n\n\n  Spring.prototype.getStartValue = function getStartValue() {\n    return this._startValue;\n  };\n\n  /**\n   * Retrieve the current value of the Spring.\n   * @public\n   */\n\n\n  Spring.prototype.getCurrentValue = function getCurrentValue() {\n    return this._currentState.position;\n  };\n\n  /**\n   * Get the absolute distance of the Spring from its resting endValue\n   * position.\n   * @public\n   */\n\n\n  Spring.prototype.getCurrentDisplacementDistance = function getCurrentDisplacementDistance() {\n    return this.getDisplacementDistanceForState(this._currentState);\n  };\n\n  /**\n   * Get the absolute distance of the Spring from a given state value\n   */\n\n\n  Spring.prototype.getDisplacementDistanceForState = function getDisplacementDistanceForState(state) {\n    return Math.abs(this._endValue - state.position);\n  };\n\n  /**\n   * Set the endValue or resting position of the spring. If this\n   * value is different than the current value, the SpringSystem will\n   * be notified and will begin running its solver loop to resolve\n   * the Spring to equilibrium. Any listeners that are registered\n   * for onSpringEndStateChange will also be notified of this update\n   * immediately.\n   * @public\n   */\n\n\n  Spring.prototype.setEndValue = function setEndValue(endValue) {\n    if (this._endValue === endValue && this.isAtRest()) {\n      return this;\n    }\n    this._startValue = this.getCurrentValue();\n    this._endValue = endValue;\n    this._springSystem.activateSpring(this.getId());\n    for (var i = 0, len = this.listeners.length; i < len; i++) {\n      var listener = this.listeners[i];\n      var onChange = listener.onSpringEndStateChange;\n      onChange && onChange(this);\n    }\n    return this;\n  };\n\n  /**\n   * Retrieve the endValue or resting position of this spring.\n   * @public\n   */\n\n\n  Spring.prototype.getEndValue = function getEndValue() {\n    return this._endValue;\n  };\n\n  /**\n   * Set the current velocity of the Spring, in pixels per second. As\n   * previously mentioned, this can be useful when you are performing\n   * a direct manipulation gesture. When a UI element is released you\n   * may call setVelocity on its animation Spring so that the Spring\n   * continues with the same velocity as the gesture ended with. The\n   * friction, tension, and displacement of the Spring will then\n   * govern its motion to return to rest on a natural feeling curve.\n   * @public\n   */\n\n\n  Spring.prototype.setVelocity = function setVelocity(velocity) {\n    if (velocity === this._currentState.velocity) {\n      return this;\n    }\n    this._currentState.velocity = velocity;\n    this._springSystem.activateSpring(this.getId());\n    return this;\n  };\n\n  /**\n   * Get the current velocity of the Spring, in pixels per second.\n   * @public\n   */\n\n\n  Spring.prototype.getVelocity = function getVelocity() {\n    return this._currentState.velocity;\n  };\n\n  /**\n   * Set a threshold value for the movement speed of the Spring below\n   * which it will be considered to be not moving or resting.\n   * @public\n   */\n\n\n  Spring.prototype.setRestSpeedThreshold = function setRestSpeedThreshold(restSpeedThreshold) {\n    this._restSpeedThreshold = restSpeedThreshold;\n    return this;\n  };\n\n  /**\n   * Retrieve the rest speed threshold for this Spring.\n   * @public\n   */\n\n\n  Spring.prototype.getRestSpeedThreshold = function getRestSpeedThreshold() {\n    return this._restSpeedThreshold;\n  };\n\n  /**\n   * Set a threshold value for displacement below which the Spring\n   * will be considered to be not displaced i.e. at its resting\n   * `endValue`.\n   * @public\n   */\n\n\n  Spring.prototype.setRestDisplacementThreshold = function setRestDisplacementThreshold(displacementFromRestThreshold) {\n    this._displacementFromRestThreshold = displacementFromRestThreshold;\n  };\n\n  /**\n   * Retrieve the rest displacement threshold for this spring.\n   * @public\n   */\n\n\n  Spring.prototype.getRestDisplacementThreshold = function getRestDisplacementThreshold() {\n    return this._displacementFromRestThreshold;\n  };\n\n  /**\n   * Enable overshoot clamping. This means that the Spring will stop\n   * immediately when it reaches its resting position regardless of\n   * any existing momentum it may have. This can be useful for certain\n   * types of animations that should not oscillate such as a scale\n   * down to 0 or alpha fade.\n   * @public\n   */\n\n\n  Spring.prototype.setOvershootClampingEnabled = function setOvershootClampingEnabled(enabled) {\n    this._overshootClampingEnabled = enabled;\n    return this;\n  };\n\n  /**\n   * Check if overshoot clamping is enabled for this spring.\n   * @public\n   */\n\n\n  Spring.prototype.isOvershootClampingEnabled = function isOvershootClampingEnabled() {\n    return this._overshootClampingEnabled;\n  };\n\n  /**\n   * Check if the Spring has gone past its end point by comparing\n   * the direction it was moving in when it started to the current\n   * position and end value.\n   * @public\n   */\n\n\n  Spring.prototype.isOvershooting = function isOvershooting() {\n    var start = this._startValue;\n    var end = this._endValue;\n    return this._springConfig.tension > 0 && (start < end && this.getCurrentValue() > end || start > end && this.getCurrentValue() < end);\n  };\n\n  /**\n   * The main solver method for the Spring. It takes\n   * the current time and delta since the last time step and performs\n   * an RK4 integration to get the new position and velocity state\n   * for the Spring based on the tension, friction, velocity, and\n   * displacement of the Spring.\n   * @public\n   */\n\n\n  Spring.prototype.advance = function advance(time, realDeltaTime) {\n    var isAtRest = this.isAtRest();\n\n    if (isAtRest && this._wasAtRest) {\n      return;\n    }\n\n    var adjustedDeltaTime = realDeltaTime;\n    if (realDeltaTime > Spring.MAX_DELTA_TIME_SEC) {\n      adjustedDeltaTime = Spring.MAX_DELTA_TIME_SEC;\n    }\n\n    this._timeAccumulator += adjustedDeltaTime;\n\n    var tension = this._springConfig.tension;\n    var friction = this._springConfig.friction;\n    var position = this._currentState.position;\n    var velocity = this._currentState.velocity;\n    var tempPosition = this._tempState.position;\n    var tempVelocity = this._tempState.velocity;\n    var aVelocity = void 0;\n    var aAcceleration = void 0;\n    var bVelocity = void 0;\n    var bAcceleration = void 0;\n    var cVelocity = void 0;\n    var cAcceleration = void 0;\n    var dVelocity = void 0;\n    var dAcceleration = void 0;\n    var dxdt = void 0;\n    var dvdt = void 0;\n\n    while (this._timeAccumulator >= Spring.SOLVER_TIMESTEP_SEC) {\n      this._timeAccumulator -= Spring.SOLVER_TIMESTEP_SEC;\n\n      if (this._timeAccumulator < Spring.SOLVER_TIMESTEP_SEC) {\n        this._previousState.position = position;\n        this._previousState.velocity = velocity;\n      }\n\n      aVelocity = velocity;\n      aAcceleration = tension * (this._endValue - tempPosition) - friction * velocity;\n\n      tempPosition = position + aVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5;\n      tempVelocity = velocity + aAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5;\n      bVelocity = tempVelocity;\n      bAcceleration = tension * (this._endValue - tempPosition) - friction * tempVelocity;\n\n      tempPosition = position + bVelocity * Spring.SOLVER_TIMESTEP_SEC * 0.5;\n      tempVelocity = velocity + bAcceleration * Spring.SOLVER_TIMESTEP_SEC * 0.5;\n      cVelocity = tempVelocity;\n      cAcceleration = tension * (this._endValue - tempPosition) - friction * tempVelocity;\n\n      tempPosition = position + cVelocity * Spring.SOLVER_TIMESTEP_SEC;\n      tempVelocity = velocity + cAcceleration * Spring.SOLVER_TIMESTEP_SEC;\n      dVelocity = tempVelocity;\n      dAcceleration = tension * (this._endValue - tempPosition) - friction * tempVelocity;\n\n      dxdt = 1.0 / 6.0 * (aVelocity + 2.0 * (bVelocity + cVelocity) + dVelocity);\n      dvdt = 1.0 / 6.0 * (aAcceleration + 2.0 * (bAcceleration + cAcceleration) + dAcceleration);\n\n      position += dxdt * Spring.SOLVER_TIMESTEP_SEC;\n      velocity += dvdt * Spring.SOLVER_TIMESTEP_SEC;\n    }\n\n    this._tempState.position = tempPosition;\n    this._tempState.velocity = tempVelocity;\n\n    this._currentState.position = position;\n    this._currentState.velocity = velocity;\n\n    if (this._timeAccumulator > 0) {\n      this._interpolate(this._timeAccumulator / Spring.SOLVER_TIMESTEP_SEC);\n    }\n\n    if (this.isAtRest() || this._overshootClampingEnabled && this.isOvershooting()) {\n      if (this._springConfig.tension > 0) {\n        this._startValue = this._endValue;\n        this._currentState.position = this._endValue;\n      } else {\n        this._endValue = this._currentState.position;\n        this._startValue = this._endValue;\n      }\n      this.setVelocity(0);\n      isAtRest = true;\n    }\n\n    var notifyActivate = false;\n    if (this._wasAtRest) {\n      this._wasAtRest = false;\n      notifyActivate = true;\n    }\n\n    var notifyAtRest = false;\n    if (isAtRest) {\n      this._wasAtRest = true;\n      notifyAtRest = true;\n    }\n\n    this.notifyPositionUpdated(notifyActivate, notifyAtRest);\n  };\n\n  Spring.prototype.notifyPositionUpdated = function notifyPositionUpdated(notifyActivate, notifyAtRest) {\n    for (var i = 0, len = this.listeners.length; i < len; i++) {\n      var listener = this.listeners[i];\n      if (notifyActivate && listener.onSpringActivate) {\n        listener.onSpringActivate(this);\n      }\n\n      if (listener.onSpringUpdate) {\n        listener.onSpringUpdate(this);\n      }\n\n      if (notifyAtRest && listener.onSpringAtRest) {\n        listener.onSpringAtRest(this);\n      }\n    }\n  };\n\n  /**\n   * Check if the SpringSystem should advance. Springs are advanced\n   * a final frame after they reach equilibrium to ensure that the\n   * currentValue is exactly the requested endValue regardless of the\n   * displacement threshold.\n   * @public\n   */\n\n\n  Spring.prototype.systemShouldAdvance = function systemShouldAdvance() {\n    return !this.isAtRest() || !this.wasAtRest();\n  };\n\n  Spring.prototype.wasAtRest = function wasAtRest() {\n    return this._wasAtRest;\n  };\n\n  /**\n   * Check if the Spring is atRest meaning that it's currentValue and\n   * endValue are the same and that it has no velocity. The previously\n   * described thresholds for speed and displacement define the bounds\n   * of this equivalence check. If the Spring has 0 tension, then it will\n   * be considered at rest whenever its absolute velocity drops below the\n   * restSpeedThreshold.\n   * @public\n   */\n\n\n  Spring.prototype.isAtRest = function isAtRest() {\n    return Math.abs(this._currentState.velocity) < this._restSpeedThreshold && (this.getDisplacementDistanceForState(this._currentState) <= this._displacementFromRestThreshold || this._springConfig.tension === 0);\n  };\n\n  /**\n   * Force the spring to be at rest at its current position. As\n   * described in the documentation for setCurrentValue, this method\n   * makes it easy to do synchronous non-animated updates to ui\n   * elements that are attached to springs via SpringListeners.\n   * @public\n   */\n\n\n  Spring.prototype.setAtRest = function setAtRest() {\n    this._endValue = this._currentState.position;\n    this._tempState.position = this._currentState.position;\n    this._currentState.velocity = 0;\n    return this;\n  };\n\n  Spring.prototype._interpolate = function _interpolate(alpha) {\n    this._currentState.position = this._currentState.position * alpha + this._previousState.position * (1 - alpha);\n    this._currentState.velocity = this._currentState.velocity * alpha + this._previousState.velocity * (1 - alpha);\n  };\n\n  Spring.prototype.getListeners = function getListeners() {\n    return this.listeners;\n  };\n\n  Spring.prototype.addListener = function addListener(newListener) {\n    this.listeners.push(newListener);\n    return this;\n  };\n\n  Spring.prototype.removeListener = function removeListener(listenerToRemove) {\n    removeFirst(this.listeners, listenerToRemove);\n    return this;\n  };\n\n  Spring.prototype.removeAllListeners = function removeAllListeners() {\n    this.listeners = [];\n    return this;\n  };\n\n  Spring.prototype.currentValueIsApproximately = function currentValueIsApproximately(value) {\n    return Math.abs(this.getCurrentValue() - value) <= this.getRestDisplacementThreshold();\n  };\n\n  return Spring;\n}();\n\nSpring._ID = 0;\nSpring.MAX_DELTA_TIME_SEC = 0.064;\nSpring.SOLVER_TIMESTEP_SEC = 0.001;\n\n/**\n * A set of Springs that all run on the same physics\n * timing loop. To get started with a Rebound animation, first\n * create a new SpringSystem and then add springs to it.\n * @public\n */\n\nvar SpringSystem = function () {\n  function SpringSystem(looper) {\n    classCallCheck(this, SpringSystem);\n    this.listeners = [];\n    this._activeSprings = [];\n    this._idleSpringIndices = [];\n    this._isIdle = true;\n    this._lastTimeMillis = -1;\n    this._springRegistry = {};\n\n    this.looper = looper || new AnimationLooper();\n    this.looper.springSystem = this;\n  }\n\n  /**\n   * A SpringSystem is iterated by a looper. The looper is responsible\n   * for executing each frame as the SpringSystem is resolved to idle.\n   * There are three types of Loopers described below AnimationLooper,\n   * SimulationLooper, and SteppingSimulationLooper. AnimationLooper is\n   * the default as it is the most useful for common UI animations.\n   * @public\n   */\n\n\n  SpringSystem.prototype.setLooper = function setLooper(looper) {\n    this.looper = looper;\n    looper.springSystem = this;\n  };\n\n  /**\n   * Add a new spring to this SpringSystem. This Spring will now be solved for\n   * during the physics iteration loop. By default the spring will use the\n   * default Origami spring config with 40 tension and 7 friction, but you can\n   * also provide your own values here.\n   * @public\n   */\n\n\n  SpringSystem.prototype.createSpring = function createSpring(tension, friction) {\n    var springConfig = void 0;\n    if (tension === undefined || friction === undefined) {\n      springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;\n    } else {\n      springConfig = SpringConfig.fromOrigamiTensionAndFriction(tension, friction);\n    }\n    return this.createSpringWithConfig(springConfig);\n  };\n\n  /**\n   * Add a spring with a specified bounciness and speed. To replicate Origami\n   * compositions based on PopAnimation patches, use this factory method to\n   * create matching springs.\n   * @public\n   */\n\n\n  SpringSystem.prototype.createSpringWithBouncinessAndSpeed = function createSpringWithBouncinessAndSpeed(bounciness, speed) {\n    var springConfig = void 0;\n    if (bounciness === undefined || speed === undefined) {\n      springConfig = SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG;\n    } else {\n      springConfig = SpringConfig.fromBouncinessAndSpeed(bounciness, speed);\n    }\n    return this.createSpringWithConfig(springConfig);\n  };\n\n  /**\n   * Add a spring with the provided SpringConfig.\n   * @public\n   */\n\n\n  SpringSystem.prototype.createSpringWithConfig = function createSpringWithConfig(springConfig) {\n    var spring = new Spring(this);\n    this.registerSpring(spring);\n    spring.setSpringConfig(springConfig);\n    return spring;\n  };\n\n  /**\n   * Check if a SpringSystem is idle or active. If all of the Springs in the\n   * SpringSystem are at rest, i.e. the physics forces have reached equilibrium,\n   * then this method will return true.\n   * @public\n   */\n\n\n  SpringSystem.prototype.getIsIdle = function getIsIdle() {\n    return this._isIdle;\n  };\n\n  /**\n   * Retrieve a specific Spring from the SpringSystem by id. This\n   * can be useful for inspecting the state of a spring before\n   * or after an integration loop in the SpringSystem executes.\n   * @public\n   */\n\n\n  SpringSystem.prototype.getSpringById = function getSpringById(id) {\n    return this._springRegistry[id];\n  };\n\n  /**\n   * Get a listing of all the springs registered with this\n   * SpringSystem.\n   * @public\n   */\n\n\n  SpringSystem.prototype.getAllSprings = function getAllSprings() {\n    var vals = [];\n    for (var _id in this._springRegistry) {\n      if (this._springRegistry.hasOwnProperty(_id)) {\n        vals.push(this._springRegistry[_id]);\n      }\n    }\n    return vals;\n  };\n\n  /**\n   * Manually add a spring to this system. This is called automatically\n   * if a Spring is created with SpringSystem#createSpring.\n   *\n   * This method sets the spring up in the registry so that it can be solved\n   * in the solver loop.\n   * @public\n   */\n\n\n  SpringSystem.prototype.registerSpring = function registerSpring(spring) {\n    this._springRegistry[spring.getId()] = spring;\n  };\n\n  /**\n   * Deregister a spring with this SpringSystem. The SpringSystem will\n   * no longer consider this Spring during its integration loop once\n   * this is called. This is normally done automatically for you when\n   * you call Spring#destroy.\n   * @public\n   */\n\n\n  SpringSystem.prototype.deregisterSpring = function deregisterSpring(spring) {\n    removeFirst(this._activeSprings, spring);\n    delete this._springRegistry[spring.getId()];\n  };\n\n  SpringSystem.prototype.advance = function advance(time, deltaTime) {\n    while (this._idleSpringIndices.length > 0) {\n      this._idleSpringIndices.pop();\n    }\n    for (var i = 0, len = this._activeSprings.length; i < len; i++) {\n      var spring = this._activeSprings[i];\n      if (spring.systemShouldAdvance()) {\n        spring.advance(time / 1000.0, deltaTime / 1000.0);\n      } else {\n        this._idleSpringIndices.push(this._activeSprings.indexOf(spring));\n      }\n    }\n    while (this._idleSpringIndices.length > 0) {\n      var idx = this._idleSpringIndices.pop();\n      idx >= 0 && this._activeSprings.splice(idx, 1);\n    }\n  };\n\n  /**\n   * This is the main solver loop called to move the simulation\n   * forward through time. Before each pass in the solver loop\n   * onBeforeIntegrate is called on an any listeners that have\n   * registered themeselves with the SpringSystem. This gives you\n   * an opportunity to apply any constraints or adjustments to\n   * the springs that should be enforced before each iteration\n   * loop. Next the advance method is called to move each Spring in\n   * the systemShouldAdvance forward to the current time. After the\n   * integration step runs in advance, onAfterIntegrate is called\n   * on any listeners that have registered themselves with the\n   * SpringSystem. This gives you an opportunity to run any post\n   * integration constraints or adjustments on the Springs in the\n   * SpringSystem.\n   * @public\n   */\n\n\n  SpringSystem.prototype.loop = function loop(currentTimeMillis) {\n    var listener = void 0;\n    if (this._lastTimeMillis === -1) {\n      this._lastTimeMillis = currentTimeMillis - 1;\n    }\n    var ellapsedMillis = currentTimeMillis - this._lastTimeMillis;\n    this._lastTimeMillis = currentTimeMillis;\n\n    var i = 0;\n    var len = this.listeners.length;\n    for (i = 0; i < len; i++) {\n      listener = this.listeners[i];\n      listener.onBeforeIntegrate && listener.onBeforeIntegrate(this);\n    }\n\n    this.advance(currentTimeMillis, ellapsedMillis);\n    if (this._activeSprings.length === 0) {\n      this._isIdle = true;\n      this._lastTimeMillis = -1;\n    }\n\n    for (i = 0; i < len; i++) {\n      listener = this.listeners[i];\n      listener.onAfterIntegrate && listener.onAfterIntegrate(this);\n    }\n\n    if (!this._isIdle) {\n      this.looper.run();\n    }\n  };\n\n  /**\n   * Used to notify the SpringSystem that a Spring has become displaced.\n   * The system responds by starting its solver loop up if it is currently idle.\n   */\n\n\n  SpringSystem.prototype.activateSpring = function activateSpring(springId) {\n    var spring = this._springRegistry[springId];\n    if (this._activeSprings.indexOf(spring) === -1) {\n      this._activeSprings.push(spring);\n    }\n    if (this.getIsIdle()) {\n      this._isIdle = false;\n      this.looper.run();\n    }\n  };\n\n  /**\n   * Add a listener to the SpringSystem to receive before/after integration\n   * notifications allowing Springs to be constrained or adjusted.\n   * @public\n   */\n\n\n  SpringSystem.prototype.addListener = function addListener(listener) {\n    this.listeners.push(listener);\n  };\n\n  /**\n   * Remove a previously added listener on the SpringSystem.\n   * @public\n   */\n\n\n  SpringSystem.prototype.removeListener = function removeListener(listener) {\n    removeFirst(this.listeners, listener);\n  };\n\n  /**\n   * Remove all previously added listeners on the SpringSystem.\n   * @public\n   */\n\n\n  SpringSystem.prototype.removeAllListeners = function removeAllListeners() {\n    this.listeners = [];\n  };\n\n  return SpringSystem;\n}();\n\nvar index = _extends({}, Loopers, {\n  OrigamiValueConverter: OrigamiValueConverter,\n  MathUtil: MathUtil,\n  Spring: Spring,\n  SpringConfig: SpringConfig,\n  SpringSystem: SpringSystem,\n  util: _extends({}, util, MathUtil)\n});\n\nreturn index;\n\n})));\n"]}