-
Notifications
You must be signed in to change notification settings - Fork 0
/
vendors~work.js
1 lines (1 loc) · 8.13 KB
/
vendors~work.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{120:function(t,e,o){"use strict";var n=o(0),r=o(1),i=o.n(r),a=o(16),u=o.n(a),c=o(41),s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t};function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var f=function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)},h=function(t){function e(){var o,n;l(this,e);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return o=n=p(this,t.call.apply(t,[this].concat(i))),n.handleClick=function(t){if(n.props.onClick&&n.props.onClick(t),!t.defaultPrevented&&0===t.button&&!n.props.target&&!f(t)){t.preventDefault();var e=n.context.router.history,o=n.props,r=o.replace,i=o.to;r?e.replace(i):e.push(i)}},p(n,o)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){var t=this.props,e=(t.replace,t.to),o=t.innerRef,r=function(t,e){var o={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}(t,["replace","to","innerRef"]);u()(this.context.router,"You should not use <Link> outside a <Router>"),u()(void 0!==e,'You must specify the "to" property');var i=this.context.router.history,a="string"==typeof e?Object(c.b)(e,null,null,i.location):e,l=i.createHref(a);return n.default.createElement("a",s({},r,{onClick:this.handleClick,href:l,ref:o}))},e}(n.default.Component);h.propTypes={onClick:i.a.func,target:i.a.string,replace:i.a.bool,to:i.a.oneOfType([i.a.string,i.a.object]).isRequired,innerRef:i.a.oneOfType([i.a.string,i.a.func])},h.defaultProps={replace:!1},h.contextTypes={router:i.a.shape({history:i.a.shape({push:i.a.func.isRequired,replace:i.a.func.isRequired,createHref:i.a.func.isRequired}).isRequired}).isRequired},e.a=h},138:function(t,e,o){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e,o){var n=o(1),r=Math.sqrt(2),i=Math.cos,a=Math.max,u=Math.min;function c(t){return u(t.duration,Date.now()-t.mouseDown)}function s(t){return t.mouseUp>0?Date.now()-t.mouseUp:0}function l(t){var e=t.duration,o=t.radius,r=.85*n(c(t),0,o,e),u=.15*n(s(t),0,o,e),l=.02*o*i(Date.now()/e);return a(0,r+u+l)}t.exports={getMaxRadius:function(t,e,o){return u(.5*a(t,e),o)},getBlotOpacity:function(t,e){return n(s(t),e,-e,t.duration)},getBlotOuterOpacity:function(t,e){return u(this.getBlotOpacity(t,e),n(c(t),0,.3,3*t.duration))},getBlotShiftX:function(t,e,o){return u(1,l(t)/e*2/r)*(o/2-t.x)},getBlotShiftY:function(t,e,o){return u(1,l(t)/e*2/r)*(o/2-t.y)},getBlotScale:function(t){return l(t)/t.radius}}},function(t,e){t.exports=function(t,e,o,n){return o*((t=t/n-1)*t*t*t*t+1)+e}},function(t,e,o){var n=o(0),r=function(t){var e=t.mouseUp,o=t.duration;return!e||Date.now()-e<o};t.exports=function(t){var e=[],o=!1,i=void 0,a={each:function(t,o){for(var n=0,r=e.length;n<r;n++)t.call(o,e[n])},play:function(){o||(o=!0,a.update())},stop:function(){o=!1,cancelAnimationFrame(i)},getTotalOpacity:function(t){for(var o=0,r=0,i=e.length;r<i;r++)o+=n.getBlotOuterOpacity(e[r],t);return o},update:function(){(e=e.filter(r)).length?i=requestAnimationFrame(a.update):a.stop(),t()},add:function(t){e.push(t),a.play()},release:function(t){for(var o=e.length-1;o>=0;o--)if(!e[o].mouseUp)return e[o].mouseUp=t}};return a}},function(t,e){t.exports={borderRadius:"inherit",height:"100%",left:0,position:"absolute",top:0,width:"100%"}},function(t,e){t.exports=o(0)},function(t,e){t.exports=function(t){return(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},function(t,e){var o=!1;"undefined"!=typeof window&&(o="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),t.exports=o},function(t,e,o){var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},r=o(6),i=o(5),a=o(4),u=o(3),c=o(2),s=2*Math.PI,l=o(0),p=function(t){function e(o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments));return n.tick=function(){var t=n.state,e=t.ctx,o=t.color,r=t.density,i=t.height,a=t.width,u=t.store;e.save(),e.scale(r,r),e.clearRect(0,0,a,i),e.fillStyle=o,n.props.background&&(e.globalAlpha=u.getTotalOpacity(n.props.opacity),e.fillRect(0,0,a,i)),u.each(n.makeBlot,n),e.restore()},n._onPress=function(t){var e=t.button,o=t.ctrlKey,r=t.clientX,i=t.clientY,a=t.changedTouches,u=Date.now();if(a)for(var c=0;c<a.length;c++){var s=a[c],l=s.clientX,p=s.clientY;n.pushBlot(u,l,p)}else 0!==e||o||n.pushBlot(u,r,i)},n._onRelease=function(){n.state.store.release(Date.now())},n.state={color:"transparent",density:1,height:0,store:c(n.tick),touchEvents:n.touchEvents(),width:0},n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.touchEvents=function(){return this.props.hasTouch?{onTouchStart:this._onPress,onTouchEnd:this._onRelease,onTouchCancel:this._onRelease}:{onMouseDown:this._onPress,onMouseUp:this._onRelease,onMouseLeave:this._onRelease}},e.prototype.makeBlot=function(t){var e=this.state,o=e.ctx,n=e.height,r=e.width,i=t.x,a=t.y,u=t.radius;if(o.globalAlpha=l.getBlotOpacity(t,this.props.opacity),o.beginPath(),this.props.recenter){var c=Math.max(n,r);i+=l.getBlotShiftX(t,c,r),a+=l.getBlotShiftY(t,c,n)}o.arc(i,a,u*l.getBlotScale(t),0,s),o.closePath(),o.fill()},e.prototype.componentWillUnmount=function(){this.state.store.stop()},e.prototype.pushBlot=function(t,e,o){var n=this,r=this.canvas;r.getDOMNode&&"function"==typeof r.getDOMNode&&(r=r.getDOMNode());var a=r.getBoundingClientRect(),u=a.top,c=a.bottom,s=a.left,p=a.right,f=window.getComputedStyle(r).color,h=this.state.ctx||r.getContext("2d"),d=i(h),y=c-u,g=p-s,v=l.getMaxRadius(y,g,this.props.radius);this.setState({color:f,ctx:h,density:d,height:y,width:g},(function(){n.state.store.add({duration:n.props.duration,mouseDown:t,mouseUp:0,radius:v,x:e-s,y:o-u})}))},e.prototype.setCanvas=function(t){this.canvas=t},e.prototype.render=function(){var t=this.state,e=t.className,o=t.density,r=t.height,i=t.width,c=t.touchEvents;return a.createElement("canvas",n({className:e,ref:this.setCanvas.bind(this),style:n({},u,this.props.style),height:r*o,width:i*o,onDragOver:this._onRelease},c))},e}(a.PureComponent);p.defaultProps={background:!0,className:"ink",duration:1e3,opacity:.25,radius:150,recenter:!0,hasTouch:r},t.exports=p}])}}]);