honkoma/priv/static/packs/containers/media_container.js

2 lines
178 KiB
JavaScript
Raw Normal View History

2018-09-16 21:17:34 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{102:function(e,t,n){"use strict";t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function i(e){return e&&e.__esModule?e:{default:e}}var o=i(n(312)),a=i(n(313)),_=i(n(314)),O=i(n(315)),s=i(n(297)),j=i(n(317)),u=i(n(3)),l=i(n(5)),w=1e3/60,d=function(t){function n(e){var g=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,e),this.wasAnimating=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyle=null,this.clearUnreadPropStyle=function(e){var t=!1,n=g.state,r=n.currentStyle,i=n.currentVelocity,o=n.lastIdealStyle,a=n.lastIdealVelocity;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var u=e[s];"number"==typeof u&&(t||(t=!0,r=c({},r),i=c({},i),o=c({},o),a=c({},a)),r[s]=u,i[s]=0,o[s]=u,a[s]=0)}t&&g.setState({currentStyle:r,currentVelocity:i,lastIdealStyle:o,lastIdealVelocity:a})},this.startAnimationIfNecessary=function(){g.animationID=s.default(function(e){var t=g.props.style;if(j.default(g.state.currentStyle,t,g.state.currentVelocity))return g.wasAnimating&&g.props.onRest&&g.props.onRest(),g.animationID=null,g.wasAnimating=!1,void(g.accumulatedTime=0);g.wasAnimating=!0;var n=e||O.default(),r=n-g.prevTime;if(g.prevTime=n,g.accumulatedTime=g.accumulatedTime+r,g.accumulatedTime>10*w&&(g.accumulatedTime=0),0===g.accumulatedTime)return g.animationID=null,void g.startAnimationIfNecessary();var i=(g.accumulatedTime-Math.floor(g.accumulatedTime/w)*w)/w,o=Math.floor(g.accumulatedTime/w),a={},s={},u={},c={};for(var l in t)if(Object.prototype.hasOwnProperty.call(t,l)){var d=t[l];if("number"==typeof d)u[l]=d,c[l]=0,a[l]=d,s[l]=0;else{for(var f=g.state.lastIdealStyle[l],h=g.state.lastIdealVelocity[l],p=0;p<o;p++){var v=_.default(w/1e3,f,h,d.val,d.stiffness,d.damping,d.precision);f=v[0],h=v[1]}var m=_.default(w/1e3,f,h,d.val,d.stiffness,d.damping,d.precision),y=m[0],b=m[1];u[l]=f+(y-f)*i,c[l]=h+(b-h)*i,a[l]=f,s[l]=h}}g.animationID=null,g.accumulatedTime-=o*w,g.setState({currentStyle:u,currentVelocity:c,lastIdealStyle:a,lastIdealVelocity:s}),g.unreadPropStyle=null,g.startAnimationIfNecessary()})},this.state=this.defaultState()}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),r(n,null,[{key:"propTypes",value:{defaultStyle:l.default.objectOf(l.default.number),style:l.default.objectOf(l.default.oneOfType([l.default.number,l.default.object])).isRequired,children:l.default.func.isRequired,onRest:l.default.func},enumerable:!0}]),n.prototype.defaultState=function(){var e=this.props,t=e.defaultStyle,n=e.style,r=t||a.default(n),i=o.default(r);return{currentStyle:r,currentVelocity:i,lastIdealStyle:r,lastIdealVelocity:i}},n.prototype.componentDidMount=function(){this.prevTime=O.default(),this.startAnimationIfNecessary()},n.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyle&&this.clearUnreadPropStyle(this.unreadPropStyle),this.unreadPropStyle=e.style,null==this.animationID&&(this.prevTime=O.default(),this.startAnimationIfNecessary())},n.prototype.componentWillUnmount=function(){null!=this.animationID&&(s.default.cancel(this.animationID),this.animationID=null)},n.prototype.render=function(){var e=this.props.children(this.state.currentStyle);return e&&u.default.Children.only(e)},n}(u.default.Component);t.default=d,e.exports=t.default},107:function(e,t,n){"use strict";var r=n(30),i=n(1),o=n(6),a=n(3),s=n.n(a),u=n(102),c=
2018-08-12 13:29:30 +00:00
//# sourceMappingURL=media_container.js.map